window.___gcfg = {lang: 'en-GB'};

var siteName = "Owning an Electric Car";
var hostName = "http://www.OwningElectricCar.com";
var facebookID = "1173524527"

function FacebookSetup(title, image)
{
		GooglePlusOne();
 		var url=window.location.host + window.location.pathname;
    document.write("<meta property='og:title' content='" + title + "' />");
		document.write("<meta property='og:type' content='article' />");
		document.write("<meta property='og:url' content='" + url + "' />");
		document.write("<meta property='og:image' content='" + hostName + "/images/" + image + "' />");
		document.write("<meta property='og:site_name' content='" + siteName + "' />");
		document.write("<meta property='fb:admins' content='" + facebookID + "' />");
}

function Facebook()
{
 		Author('');
}

function GooglePlusOne() 
{
    var po = document.createElement('script'); po.type = 'text/javascript'; po.async = true;
    po.src = 'https://apis.google.com/js/plusone.js';
    var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
}

function FacebookButton()
{
 		var url=window.location.host + window.location.pathname;
    document.write("<iframe src='http://www.facebook.com/plugins/like.php?href=" + url + "&amp;layout=standard&amp;show_faces=false&amp;width=300&amp;action=like&amp;font&amp;colorscheme=light&amp;height=35' scrolling='no' frameborder='0' style='border:none; overflow:hidden; width:300px; height:35px;' allowTransparency='true'></iframe>");
}

function Author(name)
{
		var url = window.location.host + window.location.pathname;
		
		// Replace all the '/'s in the URL
		
		url = url.replace('/','%2F');
		url = url.replace('/','%2F');
		url = url.replace('/','%2F');
		url = url.replace('/','%2F');
		url = url.replace('/','%2F');
		url = url.replace('/','%2F');
		
		var facebook="http://www.facebook.com/plugins/like.php?href=" + url + "&amp;layout=standard&amp;show_faces=false&amp;width=250&amp;action=like&amp;font&amp;colorscheme=light&amp;height=35";
		
		document.write("<p>");
		document.write("  <center>");
		document.write("			<iframe src=" + facebook + " scrolling=no height=35 frameborder=0 style=border:none; overflow:hidden; width:250px; height:35px; allowTransparency=true></iframe>");
		document.write("			<br />");
		document.write("			<g:plusone></g:plusone>");
		document.write("	</center>");
		document.write("</p>");
		
 		name = name.toLowerCase();
    switch(name)
		{
				case "angela":
				case "angela boxwell":
				case "angie":
				case "angie boxwell":
				case "aboxwell":
				case "aboxwell":
				case "ab":
				case "alb":
						 document.write("<!--Author: Angela Boxwell-->");
						 document.write("<p style='font-size:0.75em; font-style:italic;'>");
						 document.write("  <img src=images/angela-tata-small.jpg class=LeftImageWithBorder align=left>");
						 document.write("  Angela Boxwell is an electric car enthusiast and regularly blogs about electric cars. For updates on this blog, click on the 'follow me' button below:");
						 document.write("</p>");
						 document.write("<p>");
             document.write("  <a href=http://www.twitter.com/ElectricCarInfo target=_blank>");
						 document.write("    <img src=http://twitter-badges.s3.amazonaws.com/follow_me-a.png alt=Follow Angela Boxwell on Twitter/>");
						 document.write("  </a>");
             document.write("</p>");
						 break;
						 
				case "michael":
				case "mike":
				case "michael boxwell":
				case "mike boxwell":
				case "mboxwell":
				case "mb":
				case "mpb":
						 document.write("<!--Author: Michael Boxwell-->");
						 document.write("<p>");
						 document.write("  <img src=images/michael-twitter.jpg class=LeftImage align=left border=1>");
						 document.write("  <b>Michael Boxwell</b> is an electric car enthusiast and regularly blogs about electric cars. For updates on this blog, click on the 'follow me' button below:");
						 document.write("</p>");
						 document.write("<p>");
             document.write("  <a href=http://www.twitter.com/MikeBoxwell>");
						 document.write("    <img src=http://twitter-badges.s3.amazonaws.com/follow_me-a.png alt=Follow Michael Boxwell on Twitter/>");
						 document.write("  </a>");
             document.write("</p>");
						 break;						 
		}
}


function RightColumnBookAdvert()
{
    var bookCover = "<a href='http://issuu.com/greenstream/docs/the2011electriccarguide?viewMode=magazine&mode=embed' target='_new'><img src='images/look-inside.jpg' width='186' height='31' alt='Look Inside' title='Look Inside' border='0' /><img src='images/owning-an-electric-car.jpg' alt='The 2011 Electric Car Guide' align='center' title='The 2011 Electric Car Guide' border='0' /></a>";
		var book  = "<a href='electric-car-book.html'>The Electric Car Guide</a> ";
		var amazonID = "1907670068";
		var now = new Date();
		var randomSeed = now.getSeconds();
		if (randomSeed > 9) randomSeed -= 10;
		if (randomSeed > 9) randomSeed -= 10;
		if (randomSeed > 9) randomSeed -= 10;
		if (randomSeed > 9) randomSeed -= 10;
		if (randomSeed > 9) randomSeed -= 10;
		if (randomSeed > 9) randomSeed -= 10;

		// First we look at the picture at the top and rotate that
		
		switch (randomSeed)
		{
		    case 0:
				case 1:
				case 2:
						 document.write("<br /><center>" + bookCover + "</center>");
						 break;
				case 3:
				case 4:
				case 5:
						 document.write("<h2><strong>Find out about electric cars for yourself</strong></h2>");
						 document.write("<center>" + bookCover + "</center>");
						 break;
				case 6:
				case 7:
				case 8:
				case 9:
						 document.write("<h2><strong>Why should I consider an electric car?</strong></h2>");
						 document.write("<center>" + bookCover + "</center>");
						 break;
		}
		
		
		// Now we look at the text and rotate that
		
		document.write("<br /><p>");
		switch (randomSeed)
		{
		    case 0:
				case 3:
				case 6:
				case 9:
						 document.write(book + "is the best selling book on electric car ownership worldwide. Published by Greenstream Publishing, it gives you all the information you need to help you decide whether an electric car is the right choice for you.");
						 break;
				case 1:
				case 4:
				case 7:
						 document.write("Are you curious about electric cars? Want to know where to turn for good advice, written by the people who use them? " + book + " is the most comprehensive guide about electric cars available today: written and edited by people who have years of experience of using them on a daily basis.");
						 break;
				case 2:
				case 5:
				case 8:
						 document.write("Could an electric car work for me? What about the cost? The range? How do I charge up? What are they like to drive?</p><p>All these questions and more are answered in our new book - " + book + " - the most comprehensive guide to electric cars available today.");
						 break;
		}
		document.write("</p>");
		
		// Amazon links

		document.write("<p>Buy your copy of " + book + " today:</p>");
		Flags(amazonID);
}


function Flags(amazonID)
{
    document.write("<table>");
	document.write("<table border='0'>");
    document.write("<tr>");
    document.write("<td valign='top'><center>");
    document.write("<a href='http://www.amazon.com/gp/product/1907670068/ref=as_li_tf_tl?ie=UTF8&tag=ownelecar-20&linkCode=as2&camp=217145&creative=399373&creativeASIN=1907670068' target='new'>");
    document.write("<img src='images/usa.png' width='80' height='80' alt='United States'><br />");
    document.write("Amazon United States");
    document.write("</a>");
    document.write("</center></td>");
    document.write("<td valign='top'><center>");
    document.write("<a href='http://www.amazon.co.uk/gp/product/1907670068/ref=as_li_tf_tl?ie=UTF8&tag=gwizelecarown-21&linkCode=as2&camp=1634&creative=6738&creativeASIN=1907670068' target='new'>");
    document.write("<img src='images/gbr.png' width='80' height='80' alt='United Kingdom'><br />");
    document.write("Amazon United Kingdom");
    document.write("</a>");
    document.write("</center></td>");
    document.write("<td valign='top'><center>");
    document.write("<a href='http://www.amazon.ca/gp/product/1907670068/ref=as_li_tf_tl?ie=UTF8&tag=ownelecar05-20&linkCode=as2&camp=15121&creative=330641&creativeASIN=1907670068' target='new'>");
    document.write("<img src='images/can.png' width='80' height='80' alt='Canada'><br />");
    document.write("Amazon Canada");
    document.write("</a>");
    document.write("</center></td>");
    document.write("</tr>");
    document.write("</table>");
}


function Menu()
{
    document.write("<div id=wrap>");
    document.write("		<h4><span>&nbsp;</span></h4>");
    document.write("<div id=nav-wrap>");
    document.write("		<ul id=primary-nav>");
    document.write("		 		 <li><a href=index.html title='Owning electric car' class=on>Owning<br />Electric Car</a></li>");
    document.write("				 <li><a href=about-electric-car.html title='Electric car book'>Electric Car<br />Book</a></li>");
    document.write("				 <li><a href=electric-car-blog.html title='Electric Car Blog'>Electric Car<br />Blog</a></li>");
	document.write("				 <li><a href=electric-cars-list.html title='Electric Cars List'>Electric Car<br />Reviews</a></li>");
    document.write("				 <li><a href=electric-car-information.html title='Electric Car Information'>Electric Car<br />Information</a></li>");
    document.write("				 <li><a href=national-grid-electric.html title='National Grid Electric'>National Grid<br />Electric</a></li>");
    document.write("		<li><a href=electric-car-faq.aspx title='Electric Car Questions'>Electric Car<br />Questions</a></li>");
   
    document.write("		<li><a href=electric-car-media.html title='Media Information'>Media<br /> Information</a></li>");
    document.write("		</ul>");
    document.write("</div>");
    document.write("<div id=promo-area><a href=leisure.html title=><img src=images/pic_promo.jpg alt= /></a></div>");
}

function Footer2()
{
    document.write("    <div id=foot>");
    document.write("      <ul class=footlist>");
    document.write("        <li class=footis footis-first=>");
    document.write("          <ul>");
		document.write("            <li><b>Manufacturers</b></li>");
    document.write("            <li><a href=aixam-cars.html title=>Aixam</a></li>");
    document.write("            <li><a href=aptera-car.html title=>Aptera</a></li>");
    document.write("            <li><a href=byd-electric-cars.html title=>BYD</a></li>");
    document.write("            <li><a href=dynasty-electric-car.html title=>Dynasty</a></li>");
		// adding new column
		document.write("          </ul>");
		document.write("				</li>");
		document.write("        <li class=footis>");
		document.write("          <ul>");
		document.write("            <li><b>&nbsp;</b></li>");
    document.write("            <li><a href=g-wiz.html title=>REVA</a></li>");
    document.write("            <li><a href=nissan-leaf.html title=>Nissan</a></li>");
		document.write("            <li><a href=mitsubishi-electric-car.html title=>Mitsubishi i MiEV</a></li>");
    document.write("          </ul>");
    document.write("        </li>");
    document.write("        <li class=footis>");
    document.write("          <ul>");
		document.write("            <li><b>Car Reviews</b></li>");
    document.write("						<li><a href=gem-e2-review.html title=>GEM e2</a></li>");
    document.write("            <li><a href=g-wiz-i-review.html title=>G_Wiz i</a></li>");
    document.write("            <li><a href=nissan-leaf-review.html title=>Nissan Leaf</a></li>");
    document.write("            <li><a href=mitsubishi-i-miev-review.html title=>Mitsubishi i MiEV</a></li>");
		
		document.write("          </ul>");
		document.write("				</li>");
		document.write("        <li class=footis>");
		document.write("          <ul>");
		document.write("            <li><b>&nbsp;</b></li>");
    document.write("            <li><a href=reva-nxr-review.html title=>REVA NXR</a></li>");
    document.write("            <li><a href=tata-indica-vista-ev.html title=>TATA Indica Vista EV</a></li>");
    document.write("            <li><a href=think-city-review.html title=>Think City</a></li>");
		document.write("          </ul>");
    document.write("        </li>");
		document.write("			</ul>");    
   document.write("    </div>");
 document.write("    <div id=foot>");
    document.write("      <p>");
	document.write("The Owning an Electric Car website is copyright 2010-2011 by <a href=http://www.greenstreampublishing.com target=new title=>GreenStream Publishing.</a>")
	document.write("      <br />");
	
    document.write(" All rights reserved. Use of this web site is subject to our <a href=website-disclaimer.html title=>Terms and Conditions.</a>");
    document.write("      </p>");
	 document.write("    </div>");
}

function Footer()
{
    document.write("	<div id=foot>");
    document.write("		<ul class=footlist>");
    
	document.write("			<li class=footis>");
	document.write("            <b>Manufacturers</b><br />");
    document.write("            <a href=aixam-cars.html title=>Aixam</a><br />");
    document.write("            <a href=aptera-car.html title=>Aptera</a><br />");
    document.write("            <a href=byd-electric-cars.html title=>BYD</a><br />");
    document.write("            <a href=dynasty-electric-car.html title=>Dynasty</a><br />");
	document.write("			</li>");

	document.write("        <li class=footis>");
	document.write("            <b>&nbsp;</b><br />");
    document.write("            <a href=g-wiz.html title=>REVA</a><br />");
    document.write("            <a href=nissan-leaf.html title=>Nissan</a><br />");
	document.write("            <a href=mitsubishi-electric-car.html title=>Mitsubishi i MiEV</a><br />");
    document.write("        </li>");

    document.write("			<li class=footis>");
	document.write("				<b>Car Reviews</b><br />");
    document.write("				<a href=gem-e2-review.html title=>GEM e2</a><br />");
    document.write("				<a href=g-wiz-i-review.html title=>G_Wiz i</a><br />");
    document.write("				<a href=nissan-leaf-review.html title=>Nissan Leaf</a><br />");
    document.write("				<a href=mitsubishi-i-miev-review.html title=>Mitsubishi i MiEV</a><br />");
	document.write("			</li>");
	
	document.write("			<li class=footis>");
	document.write("				<b>&nbsp;</b><br />");
    document.write("				<a href=reva-nxr-review.html title=>REVA NXR</a><br />");
    document.write("				<a href=tata-indica-vista-ev.html title=>TATA Indica Vista EV</a><br />");
    document.write("				<a href=think-city-review.html title=>Think City</a><br />");
    document.write("			</li>");
	
	document.write("		</ul>");    
	// document.write("	</div>");
	// document.write("	<div id=foot>");
    document.write(" 	<p><br /><br /><br /><br /><br /></p><p>");
	document.write("			The Owning an Electric Car website is copyright 2010-2011 by <a href=http://www.greenstreampublishing.com target=new title=>GreenStream Publishing.</a>")
	document.write("			<br />");
    document.write("			All rights reserved. Use of this web site is subject to our <a href=website-disclaimer.html title=>Terms and Conditions.</a>");
    document.write("		</p>");
	document.write("	</div>");
}


function YouTube( videoID )
{
 		document.write("<object>");
 		document.write("		<param name='movie' value='http://www.youtube.com/v/" + videoID + "&hl=en_GB&amp;fs=1&amp;' />");
 		document.write("		<param name='allowFullScreen' value='true' />");
 		document.write("		<param name='allowscriptaccess' value='always' />");
 		document.write("		<embed src='http://www.youtube.com/v/" + videoID + "&amp;hl=en_GB&amp;fs=1&amp;' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' align='right' width='290' height='240' />");
 		document.write("</object>");
}

function YouTubeLarge( videoID )
{
 		document.write("<object>");
 		document.write("		<param name='movie' value='http://www.youtube.com/v/" + videoID + "&hl=en_GB&amp;fs=1&amp;' />");
 		document.write("		<param name='allowFullScreen' value='true' />");
 		document.write("		<param name='allowscriptaccess' value='always' />");
 		document.write("		<embed src='http://www.youtube.com/v/" + videoID + "&amp;hl=en_GB&amp;fs=1&amp;' type='application/x-shockwave-flash' allowscriptaccess='always' allowfullscreen='true' width='600' height='475' />");
 		document.write("</object>");
}									 
									 
