<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Little things about my computer work...</title>
	<atom:link href="http://blog.bengo.us/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.bengo.us</link>
	<description></description>
	<lastBuildDate>Fri, 19 Nov 2010 10:30:32 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.1</generator>
		<item>
		<title>Custom Menu in Google Maps API v3</title>
		<link>http://blog.bengo.us/custom-menu-in-google-maps-api-v3/</link>
		<comments>http://blog.bengo.us/custom-menu-in-google-maps-api-v3/#comments</comments>
		<pubDate>Fri, 19 Nov 2010 08:58:32 +0000</pubDate>
		<dc:creator>gad</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://blog.bengo.us/?p=60</guid>
		<description><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/custom-menu-in-google-maps-api-v3/&amp;text=Custom Menu in Google Maps API v3&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
I am working with google maps api v3 for some time, isn&#8217;t perfect (check memory bugs) but it&#8217;s faster than api v2. Since default menu isn&#8217;t pretty and doesn&#8217;t include a street button, I start tweaking around the api / forums/ blogs to build my own custom menu and I&#8217;m gonna show you how you [...]]]></description>
			<content:encoded><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/custom-menu-in-google-maps-api-v3/&amp;text=Custom Menu in Google Maps API v3&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>I am working with google maps api v3 for some time, isn&#8217;t perfect (check memory bugs) but it&#8217;s faster than api v2.</p>
<p>Since default menu isn&#8217;t pretty and doesn&#8217;t include a street button, I start tweaking around the api / forums/ blogs to build my own custom menu and I&#8217;m gonna show you how you can do it in your site.</p>
<p>Firstly, let&#8217;s make a sprite for our buttons background. Chris explains better how to do it in his <a href="http://line25.com/tutorials/how-to-build-a-simple-button-with-css-image-sprites" target="_blank">Sprite Post</a>.</p>
<p><img class="alignnone" title="sprite for custom menu" src="http://images.joover.com/map01_sprite.png" alt="" width="260" height="50" /></p>
<p>Ignore the +/- buttons, aren&#8217;t used in this post.</p>
<p>Well, there is no text on buttons, we&#8217;ll put the text in javascript code below.</p>
<div class="codecolorer-container css vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br /></div></td><td><div class="css codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #6666ff;">.mycontrol</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">186px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">22px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span><br />
<br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2E5896</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Tahoma<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>display<span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>background<span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'http://images.joover.com/map01_sprite.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.map</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-70px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">36px</span><span style="color: #00AA00;">;</span><br />
<br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.map</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.map_hover</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-70px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">36px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.street</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-106px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">45px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.street</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.street_hover</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-106px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">45px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.satellite</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-151px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">55px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.satellite</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.satellite_hover</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-151px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">55px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.hybrid</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-206px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.hybrid</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.hybrid_hover</span> <span style="color: #00AA00;">&#123;</span><br />
<span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-206px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span><br />
<span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> <span style="color: #00AA00;">&#123;</span>         <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">186px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">height</span><span style="color: #00AA00;">:</span><span style="color: #933;">22px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">margin-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">10px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding-right</span><span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>        <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#2E5896</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> Tahoma<span style="color: #00AA00;">,</span> <span style="color: #993333;">sans-serif</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-size</span><span style="color: #00AA00;">:</span><span style="color: #933;">11px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">font-weight</span><span style="color: #00AA00;">:</span><span style="color: #993333;">bold</span><span style="color: #00AA00;">;</span>text-decoration<span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>    <span style="color: #000000; font-weight: bold;">cursor</span><span style="color: #00AA00;">:</span><span style="color: #993333;">pointer</span><span style="color: #00AA00;">;</span>display<span style="color: #00AA00;">:</span><span style="color: #993333;">block</span><span style="color: #00AA00;">;</span>float<span style="color: #00AA00;">:</span><span style="color: #000000; font-weight: bold;">left</span><span style="color: #00AA00;">;</span>text-align<span style="color: #00AA00;">:</span><span style="color: #993333;">center</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">padding-top</span><span style="color: #00AA00;">:</span><span style="color: #933;">3px</span><span style="color: #00AA00;">;</span>height<span style="color: #00AA00;">:</span><span style="color: #933;">20px</span><span style="color: #00AA00;">;</span>    <span style="color: #000000; font-weight: bold;">background</span><span style="color: #00AA00;">:</span><span style="color: #993333;">url</span><span style="color: #00AA00;">&#40;</span><span style="color: #ff0000;">'http://images.joover.com/map01_sprite.png'</span><span style="color: #00AA00;">&#41;</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #3333ff;">:hover </span><span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.map</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-70px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">36px</span><span style="color: #00AA00;">;</span>     <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.map</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.map_hover</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-70px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span>color<span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">36px</span><span style="color: #00AA00;">;</span>  <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.street</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-106px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>        <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.street</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.street_hover</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-106px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">45px</span><span style="color: #00AA00;">;</span>      <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.satellite</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-151px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">55px</span><span style="color: #00AA00;">;</span> <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.satellite</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.satellite_hover</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-151px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">55px</span><span style="color: #00AA00;">;</span><span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.hybrid</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-206px</span> <span style="color: #933;">-1px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>      <span style="color: #00AA00;">&#125;</span><br />
<span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.hybrid</span><span style="color: #3333ff;">:hover</span><span style="color: #00AA00;">,</span> <span style="color: #6666ff;">.mycontrol</span> a<span style="color: #6666ff;">.hybrid_hover</span> <span style="color: #00AA00;">&#123;</span>    <span style="color: #000000; font-weight: bold;">background-position</span><span style="color: #00AA00;">:</span> <span style="color: #933;">-206px</span> <span style="color: #933;">-25px</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#fff</span><span style="color: #00AA00;">;</span> <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">50px</span><span style="color: #00AA00;">;</span>         <span style="color: #00AA00;">&#125;</span></div></td></tr></tbody></table></div>
<p>Explanations on above css code:<br />
- mycontrol class represents the whole menu div<br />
- mycontrol a, a:hover &#8211; general link properties (all common properties)<br />
- mycontrol a.map, a.street, a.satellite, a.hybrid &#8211; menu buttons properties<br />
- mycontrol a.map:hover, a.street:hover, a.satellite:hover, a.hybrid:hover &#8211; menu buttons properties with hover</p>
<p>Now, let me exaplain JS code for the map type menu:</p>
<div class="codecolorer-container javascript vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br />11<br />12<br />13<br />14<br />15<br />16<br />17<br />18<br />19<br />20<br />21<br />22<br />23<br />24<br />25<br />26<br />27<br />28<br />29<br />30<br />31<br />32<br />33<br />34<br />35<br />36<br />37<br />38<br />39<br />40<br />41<br />42<br />43<br />44<br />45<br />46<br />47<br />48<br />49<br />50<br />51<br />52<br />53<br />54<br />55<br />56<br />57<br />58<br />59<br />60<br />61<br />62<br />63<br />64<br />65<br />66<br />67<br />68<br />69<br />70<br />71<br />72<br />73<br />74<br />75<br />76<br />77<br />78<br />79<br />80<br />81<br />82<br />83<br />84<br />85<br />86<br />87<br />88<br />89<br />90<br />91<br />92<br />93<br />94<br />95<br />96<br />97<br />98<br />99<br />100<br />101<br />102<br />103<br />104<br />105<br />106<br />107<br />108<br />109<br />110<br />111<br />112<br />113<br />114<br />115<br />116<br />117<br />118<br />119<br />120<br />121<br />122<br />123<br />124<br />125<br />126<br />127<br />128<br />129<br />130<br />131<br />132<br />133<br />134<br />135<br />136<br />137<br />138<br />139<br />140<br />141<br />142<br />143<br />144<br />145<br />146<br />147<br />148<br />149<br />150<br />151<br />152<br />153<br />154<br />155<br />156<br />157<br />158<br />159<br />160<br />161<br />162<br />163<br />164<br />165<br />166<br />167<br />168<br />169<br />170<br />171<br />172<br />173<br />174<br />175<br />176<br />177<br />178<br />179<br />180<br />181<br /></div></td><td><div class="javascript codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #006600; font-style: italic;">/**<br />
Declare variables needed in this code<br />
*/</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> pano <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span> &nbsp;<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> menu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">null</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> _DLAT <span style="color: #339933;">=</span> <span style="color: #CC0000;">33.029125000000</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// latitude</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> _DLNG <span style="color: #339933;">=</span> <span style="color: #339933;">-</span><span style="color: #CC0000;">117.287231000000</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// longitude</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> _DNAME <span style="color: #339933;">=</span> <span style="color: #3366CC;">&quot;main_map&quot;</span><span style="color: #339933;">;</span> <span style="color: #006600; font-style: italic;">// map div ID </span><br />
&nbsp; &nbsp; <br />
<span style="color: #006600; font-style: italic;">/**<br />
- declare new object ta (namespace)<br />
- adding a new method to ta which initialize a menu and return the code for menu<br />
**/</span><br />
<br />
&nbsp; &nbsp; ta <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; ta.<span style="color: #660066;">addMapType</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>d<span style="color: #339933;">,</span> sf<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> b <span style="color: #339933;">=</span> d.<span style="color: #660066;">init</span><span style="color: #009900;">&#40;</span>sf<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> b.<span style="color: #660066;">c</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #006600; font-style: italic;">/**<br />
- declare new object type MyMapType representing the menu<br />
*/</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; ta.<span style="color: #660066;">MyMapType</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #006600; font-style: italic;">/**<br />
- init method creates a div with four links<br />
- adding listener to each button (this.listen)<br />
- if sf is 0 then we activate Map button on first load (this.activeLink(this.c, this.map);)<br />
*/</span><br />
&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">init</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>sf<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'DIV'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'mycontrol'</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'A'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> &nbsp;<span style="color: #3366CC;">'map'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Map'</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span><span style="color: #339933;">,</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">ROADMAP</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'map'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">street</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'A'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">street</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">street</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'street'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">street</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Street'</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">street</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span><span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'street'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">street</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">satellite</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'A'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">satellite</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">satellite</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'satellite'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">satellite</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Satellite'</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">satellite</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span><span style="color: #339933;">,</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">SATELLITE</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'satellite'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">satellite</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hybrid</span> <span style="color: #339933;">=</span> document.<span style="color: #660066;">createElement</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'A'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hybrid</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hybrid</span>.<span style="color: #660066;">id</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'hybrid'</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hybrid</span>.<span style="color: #660066;">innerHTML</span> <span style="color: #339933;">=</span> <span style="color: #3366CC;">'Hybrid'</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">listen</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#91;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hybrid</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span><span style="color: #339933;">,</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">HYBRID</span><span style="color: #339933;">,</span><span style="color: #3366CC;">'hybrid'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span>.<span style="color: #660066;">appendChild</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">hybrid</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #339933;">!</span>sf<span style="color: #009900;">&#41;</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activeLink</span><span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">c</span><span style="color: #339933;">,</span> <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">map</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">return</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; <br />
<span style="color: #006600; font-style: italic;">/**<br />
- set active link (hover)<br />
- co represents menu div<br />
- d represents link name we want to make it active<br />
*/</span><br />
&nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">activeLink</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>co<span style="color: #339933;">,</span> d<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> b<span style="color: #339933;">,</span>c<span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b <span style="color: #339933;">=</span> co.<span style="color: #660066;">getElementsByTagName</span><span style="color: #009900;">&#40;</span><span style="color: #3366CC;">'A'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">for</span><span style="color: #009900;">&#40;</span>c<span style="color: #339933;">=</span><span style="color: #CC0000;">0</span><span style="color: #339933;">;</span> c <span style="color: #339933;">&lt;</span> b.<span style="color: #660066;">length</span><span style="color: #339933;">;</span> c<span style="color: #339933;">++</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; b<span style="color: #009900;">&#91;</span>c<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> b<span style="color: #009900;">&#91;</span>c<span style="color: #009900;">&#93;</span>.<span style="color: #660066;">id</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; d.<span style="color: #660066;">className</span> <span style="color: #339933;">=</span> d.<span style="color: #660066;">id</span> <span style="color: #339933;">+</span> <span style="color: #3366CC;">'_hover'</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span> <br />
&nbsp;<br />
<span style="color: #006600; font-style: italic;">/**<br />
- add a DOM listener to each link<br />
- dt is an array with link object, menu object, google map type, and link name<br />
*/</span><br />
&nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">listen</span> <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">function</span> <span style="color: #009900;">&#40;</span>dt<span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> e <span style="color: #339933;">=</span> <span style="color: #000066; font-weight: bold;">this</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">event</span>.<span style="color: #660066;">addDomListener</span><span style="color: #009900;">&#40;</span>dt<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> <span style="color: #3366CC;">'click'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #006600; font-style: italic;">// if object isn't street link, then</span><br />
<span style="color: #006600; font-style: italic;">// - make street panorama not visible,</span><br />
<span style="color: #006600; font-style: italic;">// - set map type</span><br />
<span style="color: #006600; font-style: italic;">// - set active link</span><br />
&nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span>dt<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">3</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">!=</span> <span style="color: #3366CC;">'street'</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pano.<span style="color: #660066;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #660066;">setMapTypeId</span><span style="color: #009900;">&#40;</span>dt<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">2</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; e.<span style="color: #660066;">activeLink</span><span style="color: #009900;">&#40;</span>dt<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">1</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span> dt<span style="color: #009900;">&#91;</span><span style="color: #CC0000;">0</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #006600; font-style: italic;">// else make pano visible &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pano.<span style="color: #660066;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">true</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #006600; font-style: italic;">// initialize google map &nbsp; &nbsp;</span><br />
&nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">function</span> init<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// making a new googla map latLng object using _DLAT, _DLNG</span><br />
<span style="color: #006600; font-style: italic;">// _DLAT, _DLNG are defined at the beginning of the script &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> point_0 <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">LatLng</span><span style="color: #009900;">&#40;</span>_DLAT<span style="color: #339933;">,</span> _DLNG<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<span style="color: #006600; font-style: italic;">// map options &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> myOptions <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zoom<span style="color: #339933;">:</span> <span style="color: #CC0000;">16</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; center<span style="color: #339933;">:</span> point_0<span style="color: #339933;">,</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeId<span style="color: #339933;">:</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">ROADMAP</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; navigationControl<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; navigationControlOptions<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; style<span style="color: #339933;">:</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">NavigationControlStyle</span>.<span style="color: #660066;">SMALL</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeControl<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">false</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeControlOptions<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; mapTypeIds<span style="color: #339933;">:</span> <span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">ROADMAP</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">SATELLITE</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">MapTypeId</span>.<span style="color: #660066;">HYBRID</span><span style="color: #009900;">&#93;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; streetViewControl<span style="color: #339933;">:</span> <span style="color: #003366; font-weight: bold;">true</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
<span style="color: #006600; font-style: italic;">// make a new map object</span><br />
<span style="color: #006600; font-style: italic;">// adding a new marker with custom icon</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; map <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">Map</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>_DNAME<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span> myOptions<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> marker <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">Marker</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position<span style="color: #339933;">:</span> point_0<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map<span style="color: #339933;">:</span> map<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; icon<span style="color: #339933;">:</span> <span style="color: #3366CC;">'http://images.joover.com/icons/home6.png'</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #003366; font-weight: bold;">var</span> panoramaOptions <span style="color: #339933;">=</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; position<span style="color: #339933;">:</span> point_0<span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pov<span style="color: #339933;">:</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; heading<span style="color: #339933;">:</span> <span style="color: #CC0000;">34</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pitch<span style="color: #339933;">:</span> <span style="color: #CC0000;">10</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; zoom<span style="color: #339933;">:</span> <span style="color: #CC0000;">1</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// making a new streetPanorama object &nbsp; &nbsp; &nbsp; &nbsp;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pano <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">StreetViewPanorama</span><span style="color: #009900;">&#40;</span>document.<span style="color: #660066;">getElementById</span><span style="color: #009900;">&#40;</span>_DNAME<span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; panoramaOptions<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; menu <span style="color: #339933;">=</span> <span style="color: #003366; font-weight: bold;">new</span> ta.<span style="color: #660066;">MyMapType</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
<span style="color: #006600; font-style: italic;">// adding the menu to pano </span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;pano.<span style="color: #660066;">controls</span><span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">ControlPosition</span>.<span style="color: #660066;">TOP_RIGHT</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>ta.<span style="color: #660066;">addMapType</span><span style="color: #009900;">&#40;</span>menu<span style="color: #339933;">,</span> <span style="color: #CC0000;">1</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
<span style="color: #006600; font-style: italic;">// adding the menu to map &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; </span><br />
<br />
&nbsp;map.<span style="color: #660066;">controls</span><span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">ControlPosition</span>.<span style="color: #660066;">TOP_RIGHT</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>ta.<span style="color: #660066;">addMapType</span><span style="color: #009900;">&#40;</span>menu<span style="color: #339933;">,</span> <span style="color: #CC0000;">0</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
<span style="color: #006600; font-style: italic;">// because I use same container for both panorama and map </span><br />
<span style="color: #006600; font-style: italic;">// I check for for visible_changed event on pano object</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">event</span>.<span style="color: #660066;">addListener</span><span style="color: #009900;">&#40;</span>pano<span style="color: #339933;">,</span> <span style="color: #3366CC;">'visible_changed'</span><span style="color: #339933;">,</span> <span style="color: #003366; font-weight: bold;">function</span><span style="color: #009900;">&#40;</span>ev<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span><br />
<span style="color: #006600; font-style: italic;">// if street is visible, make street link active,</span><br />
<span style="color: #006600; font-style: italic;">// remove last control, add new control div</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #000066; font-weight: bold;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000066; font-weight: bold;">this</span>.<span style="color: #660066;">getVisible</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; menu.<span style="color: #660066;">activeLink</span><span style="color: #009900;">&#40;</span>menu.<span style="color: #660066;">c</span><span style="color: #339933;">,</span> menu.<span style="color: #660066;">street</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pano.<span style="color: #660066;">controls</span><span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">ControlPosition</span>.<span style="color: #660066;">TOP_RIGHT</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; pano.<span style="color: #660066;">controls</span><span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">ControlPosition</span>.<span style="color: #660066;">TOP_RIGHT</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>menu.<span style="color: #660066;">c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span> <span style="color: #000066; font-weight: bold;">else</span> <span style="color: #009900;">&#123;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #660066;">controls</span><span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">ControlPosition</span>.<span style="color: #660066;">TOP_RIGHT</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">pop</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #660066;">controls</span><span style="color: #009900;">&#91;</span>google.<span style="color: #660066;">maps</span>.<span style="color: #660066;">ControlPosition</span>.<span style="color: #660066;">TOP_RIGHT</span><span style="color: #009900;">&#93;</span>.<span style="color: #660066;">push</span><span style="color: #009900;">&#40;</span>menu.<span style="color: #660066;">c</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #009900;">&#125;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// default settings</span><br />
&nbsp; &nbsp; &nbsp; &nbsp; pano.<span style="color: #660066;">setVisible</span><span style="color: #009900;">&#40;</span><span style="color: #003366; font-weight: bold;">false</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; map.<span style="color: #660066;">setStreetView</span><span style="color: #009900;">&#40;</span>pano<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; <br />
&nbsp; &nbsp; <br />
&nbsp; &nbsp; <span style="color: #009900;">&#125;</span><br />
&nbsp; &nbsp; <span style="color: #006600; font-style: italic;">// we call init on onload</span><br />
&nbsp; &nbsp; window.<span style="color: #000066;">onload</span> <span style="color: #339933;">=</span> init<span style="color: #339933;">;</span></div></td></tr></tbody></table></div>
<p><strong>Map Selected</strong></p>
<p><strong><a href="http://blog.bengo.us/wp-content/uploads/2010/11/sample_map4.png"><img class="aligncenter size-full wp-image-85" title="Map Type on Google Map Custom Menu" src="http://blog.bengo.us/wp-content/uploads/2010/11/sample_map4.png" alt="Map Type on Google Map Custom Menu" width="500" height="309" /></a><br />
</strong></p>
<p><strong>Street Selected</strong></p>
<p><strong><a href="http://blog.bengo.us/wp-content/uploads/2010/11/sample_street2.png"><img class="aligncenter size-full wp-image-82" title="Street Type on Google Map Custom Menu" src="http://blog.bengo.us/wp-content/uploads/2010/11/sample_street2.png" alt="Street Type on Google Map Custom Menu" width="500" height="309" /></a><br />
</strong></p>
<p><strong><a href="http://www.teamaguilar.com/home-details-090059215.html" target="_blank">Live Sample</a></strong></p>
<p>If you have questions or notes about this menu contact me;)</p>
<p>To read:<br />
<a href="http://code.google.com/apis/maps/documentation/javascript/" target="_blank">http://code.google.com/apis/maps/documentation/javascript/</a><br />
<a href="groups.google.com/group/google-maps-js-api-v3" target="_blank">groups.google.com/group/google-maps-js-api-v3</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bengo.us/custom-menu-in-google-maps-api-v3/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Windows 7 install error &#8211; cannot create system disk</title>
		<link>http://blog.bengo.us/windows-7-install-error-cannot-create-system-disk/</link>
		<comments>http://blog.bengo.us/windows-7-install-error-cannot-create-system-disk/#comments</comments>
		<pubDate>Tue, 16 Nov 2010 07:23:56 +0000</pubDate>
		<dc:creator>gad</dc:creator>
				<category><![CDATA[How To]]></category>

		<guid isPermaLink="false">http://blog.bengo.us/?p=18</guid>
		<description><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/windows-7-install-error-cannot-create-system-disk/&amp;text=Windows 7 install error &#8211; cannot create system disk&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
After few years of hard use i found out that my hdd is dying, some bad sectors appeared on it (1% of the surface). If you notice slow editor (any) file loading, saving do a hdd check for safety (hdtune), if it&#8217;s green you are physically good, the problem might be on your bios or [...]]]></description>
			<content:encoded><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/windows-7-install-error-cannot-create-system-disk/&amp;text=Windows 7 install error &#8211; cannot create system disk&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>After few years of hard use i found out that my <a href="http://www.hitachi.com">hdd is dying</a>, some bad sectors appeared on it (1% of the surface).<br />
If you notice slow editor (any) file loading, saving do a hdd check for safety (<a href="http://www.hdtune.com">hdtune)</a>, if it&#8217;s green you are physically good, the problem might be on your bios or window settings.</p>
<p>Still being a xp user on a multiple core notebook in w7 era and with my friends bugging me to install a better os (not best) i said to give it a try.</p>
<p>Do you think microsft made the install easier? NO!<br />
On disk chooser menu I got <strong>&#8220;can&#8217;t create a system disk&#8221;</strong> with no other explanation, even you select the right disk  / partition. Then, what&#8217;s wrong?</p>
<p>After few searches and reboots I found a solution:<strong> w7 install doesn&#8217;t like usb hdd&#8217;s plugged into your computer</strong>, and that is weird logic in my opinion.</p>
<p>Way to go Microsoft !</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bengo.us/windows-7-install-error-cannot-create-system-disk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>WordPress and Google Ads</title>
		<link>http://blog.bengo.us/wordpress-and-google-ads/</link>
		<comments>http://blog.bengo.us/wordpress-and-google-ads/#comments</comments>
		<pubDate>Wed, 20 Oct 2010 10:40:54 +0000</pubDate>
		<dc:creator>gad</dc:creator>
				<category><![CDATA[How To]]></category>
		<category><![CDATA[wordpress google ads php]]></category>

		<guid isPermaLink="false">http://blog.bengo.us/?p=22</guid>
		<description><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/wordpress-and-google-ads/&amp;text=WordPress and Google Ads&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
WordPress developers are offering a lot of plugin for users to install. Most of the admins don&#8217;t know that plugins are adding extra code to the core, making WP sites slower. Today I&#8217;m gonna talk about how to insert google ads in home page posts. Google doesn&#8217;t allow more than 3 ads per page and [...]]]></description>
			<content:encoded><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/wordpress-and-google-ads/&amp;text=WordPress and Google Ads&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<p>WordPress developers are offering a lot of plugin for users to install. Most of the admins don&#8217;t know that plugins are adding extra code to the core, making WP sites slower. </p>
<p>Today I&#8217;m gonna talk about how to insert google ads in home page posts. Google doesn&#8217;t allow more than 3 ads per page and with WP displaying all posts in a loop you have two options:<br />
- use a plugin to manage ads code and how to display them on site<br />
- learn how to edit wp theme and do the modifications by yourself (the code is very simple)</p>
<p>1. Go in theme editor (theme-editor.php) and open index.php file (main index template).<br />
2. Find the line</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>Replace it with</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span>have_posts<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">:</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #000088;">$post_count_g</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span></div></td></tr></tbody></table></div>
<p>$post_count_g counts number of posts in the loop<br />
We know we have 10 or 20 posts per page and only 3 ads to display but we don&#8217;t know when to stop displaying the ads.</p>
<p>3. Find the line:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #339933;">&lt;</span>p <span style="color: #000000; font-weight: bold;">class</span><span style="color: #339933;">=</span><span style="color: #0000ff;">&quot;postmetadata&quot;</span><span style="color: #339933;">&gt;</span></div></td></tr></tbody></table></div>
<p>Replace it with:</p>
<div class="codecolorer-container php vibrant" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:435px;"><table cellspacing="0" cellpadding="0"><tbody><tr><td style="padding:5px;text-align:center;color:#888888;background-color:#EEEEEE;border-right: 1px solid #9F9F9F;font: normal 12px/1.4em Monaco, Lucida Console, monospace;"><div>1<br />2<br />3<br />4<br />5<br />6<br />7<br />8<br />9<br />10<br /></div></td><td><div class="php codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$post_count_g</span> <span style="color: #339933;">&lt;</span> <span style="color: #cc66cc;">3</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
GOOGLE ADS CODE HERE<br />
<br />
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <br />
<span style="color: #009900;">&#125;</span> <br />
<span style="color: #000088;">$post_count_g</span><span style="color: #339933;">++;</span><br />
<span style="color: #000000; font-weight: bold;">?&gt;</span><br />
<br />
&lt;p class=&quot;postmetadata&quot;&gt;</div></td></tr></tbody></table></div>
<p>On each iteration of while (have_posts()) we check if post_count_g is below 3, when it reaches 3 ads are no longer displayed.<br />
Depends on your ad type you can change the 3 value ($post_count_g < 3)  to whatever ads number are you allowed to display in your page.</p>
<p>Enjoy blogging <img src='http://blog.bengo.us/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.bengo.us/wordpress-and-google-ads/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I&#8217;m lazy</title>
		<link>http://blog.bengo.us/im-lazy/</link>
		<comments>http://blog.bengo.us/im-lazy/#comments</comments>
		<pubDate>Tue, 19 Oct 2010 10:39:21 +0000</pubDate>
		<dc:creator>gad</dc:creator>
				<category><![CDATA[About Me]]></category>
		<category><![CDATA[developer thing]]></category>

		<guid isPermaLink="false">http://blog.bengo.us/?p=7</guid>
		<description><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/im-lazy/&amp;text=I&#8217;m lazy&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
After a long break I&#8217;m back blogging.  I was accused of being a lazy dude, it&#8217;s true, all developers are at some point , but I will try with this new blog to deliver more words on some common IT problems and not only. Hang on with me;)]]></description>
			<content:encoded><![CDATA[
<div style="float: right; padding-left: 5px;" class="twitterbutton"><a href="http://twitter.com/share?url=http://blog.bengo.us/im-lazy/&amp;text=I&#8217;m lazy&amp;via=&amp;related=wpglamour"><img align="right" src="http://blog.bengo.us/wp-content/plugins//easy-twitter-button/i/buttons/en/tweetn.png" style="border: none;" alt="" /></a></div>
<div>
<p>After a long break I&#8217;m back blogging.  I was accused of being a lazy dude, it&#8217;s true, all developers are at some point <img src='http://blog.bengo.us/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> , but I will try with this new blog to deliver more words on some common IT problems and not only.</p>
<p>Hang on with me;)</p>
</div>
]]></content:encoded>
			<wfw:commentRss>http://blog.bengo.us/im-lazy/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

