/*********************************************************************\
*                                                                     *
* epolys.js                                          by Mike Williams *
*                                                                     *
* A Google Maps API Extension                                         *
*                                                                     *
* Adds various Methods to GPolygon and GPolyline                      *
*                                                                     *
* .Contains(latlng) returns true is the poly contains the specified   *
*                   GLatLng                                           *
*                                                                     *
* .Area()           returns the approximate area of a poly that is    *
*                   not self-intersecting                             *
*                                                                     *
* .Distance()       returns the length of the poly path               *
*                                                                     *
* .Bounds()         returns a GLatLngBounds that bounds the poly      *
*                                                                     *
* .GetPointAtDistance() returns a GLatLng at the specified distance   *
*                   along the path.                                   *
*                   The distance is specified in metres               *
*                   Reurns null if the path is shorter than that      *
*                                                                     *
* .GetIndexAtDistance() returns the vertex number at the specified    *
*                   distance along the path.                          *
*                   The distance is specified in metres               *
*                   Reurns null if the path is shorter than that      *
*                                                                     *
* .Bearing(v1?,v2?) returns the bearing between two vertices          *
*                   if v1 is null, returns bearing from first to last *
*                   if v2 is null, returns bearing from v1 to next    *
*                                                                     *
*                                                                     *
***********************************************************************
*                                                                     *
*   This Javascript is provided by Mike Williams                      *
*   Blackpool Community Church Javascript Team                        *
*   http://www.commchurch.freeserve.co.uk/                            *
*   http://econym.googlepages.com/index.htm                           *
*                                                                     *
*   This work is licenced under a Creative Commons Licence            *
*   http://creativecommons.org/licenses/by/2.0/uk/                    *
*                                                                     *
***********************************************************************
*                                                                     *
* Version 1.1       6-Jun-2007                                        *
* Version 1.2       1-Jul-2007 - fix: Bounds was omitting vertex zero *
*                                add: Bearing                         *
*                                                                     *
\*********************************************************************/


// === A method for testing if a point is inside a polygon
// === Returns true if poly contains point
// === Algorithm shamelessly stolen from http://alienryderflex.com/polygon/ 
GPolygon.prototype.Contains = function(point) {
  var j=0;
  var oddNodes = false;
  var x = point.lng();
  var y = point.lat();
  for (var i=0; i < this.getVertexCount(); i++) {
    j++;
    if (j == this.getVertexCount()) {j = 0;}
    if (((this.getVertex(i).lat() < y) && (this.getVertex(j).lat() >= y))
    || ((this.getVertex(j).lat() < y) && (this.getVertex(i).lat() >= y))) {
      if ( this.getVertex(i).lng() + (y - this.getVertex(i).lat())
      /  (this.getVertex(j).lat()-this.getVertex(i).lat())
      *  (this.getVertex(j).lng() - this.getVertex(i).lng())<x ) {
        oddNodes = !oddNodes
      }
    }
  }
  return oddNodes;
}

// === A method which returns the approximate area of a non-intersecting polygon in square metres ===
// === It doesn't fully account for spechical geometry, so will be inaccurate for large polygons ===
// === The polygon must not intersect itself ===
GPolygon.prototype.Area = function() {
  var a = 0;
  var j = 0;
  var b = this.Bounds();
  var x0 = b.getSouthWest().lng();
  var y0 = b.getSouthWest().lat();
  for (var i=0; i < this.getVertexCount(); i++) {
    j++;
    if (j == this.getVertexCount()) {j = 0;}
    var x1 = this.getVertex(i).distanceFrom(new GLatLng(this.getVertex(i).lat(),x0));
    var x2 = this.getVertex(j).distanceFrom(new GLatLng(this.getVertex(j).lat(),x0));
    var y1 = this.getVertex(i).distanceFrom(new GLatLng(y0,this.getVertex(i).lng()));
    var y2 = this.getVertex(j).distanceFrom(new GLatLng(y0,this.getVertex(j).lng()));
    a += x1*y2 - x2*y1;
  }
  return Math.abs(a * 0.5);
}

// === A method which returns the length of a path in metres ===
GPolygon.prototype.Distance = function() {
  var dist = 0;
  for (var i=1; i < this.getVertexCount(); i++) {
    dist += this.getVertex(i).distanceFrom(this.getVertex(i-1));
  }
  return dist;
}

// === A method which returns the bounds as a GLatLngBounds ===
GPolygon.prototype.Bounds = function() {
  var bounds = new GLatLngBounds();
  for (var i=0; i < this.getVertexCount(); i++) {
    bounds.extend(this.getVertex(i));
  }
  return bounds;
}

// === A method which returns a GLatLng of a point a given distance along the path ===
// === Returns null if the path is shorter than the specified distance ===
GPolygon.prototype.GetPointAtDistance = function(metres) {
  // some awkward special cases
  if (metres == 0) return this.getVertex(0);
  if (metres < 0) return null;
  var dist=0;
  var olddist=0;
  for (var i=1; (i < this.getVertexCount() && dist < metres); i++) {
    olddist = dist;
    dist += this.getVertex(i).distanceFrom(this.getVertex(i-1));
  }
  if (dist < metres) {return null;}
  var p1= this.getVertex(i-2);
  var p2= this.getVertex(i-1);
  var m = (metres-olddist)/(dist-olddist);
  return new GLatLng( p1.lat() + (p2.lat()-p1.lat())*m, p1.lng() + (p2.lng()-p1.lng())*m);
}

// === A method which returns the Vertex number at a given distance along the path ===
// === Returns null if the path is shorter than the specified distance ===
GPolygon.prototype.GetIndexAtDistance = function(metres) {
  // some awkward special cases
  if (metres == 0) return this.getVertex(0);
  if (metres < 0) return null;
  var dist=0;
  var olddist=0;
  for (var i=1; (i < this.getVertexCount() && dist < metres); i++) {
    olddist = dist;
    dist += this.getVertex(i).distanceFrom(this.getVertex(i-1));
  }
  if (dist < metres) {return null;}
  return i;
}

// === A function which returns the bearing between two vertices in decgrees from 0 to 360===
// === If v1 is null, it returns the bearing between the first and last vertex ===
// === If v1 is present but v2 is null, returns the bearing from v1 to the next vertex ===
// === If either vertex is out of range, returns void ===
GPolygon.prototype.Bearing = function(v1,v2) {
  if (v1 == null) {
    v1 = 0;
    v2 = this.getVertexCount()-1;
  } else if (v2 ==  null) {
    v2 = v1+1;
  }
  if ((v1 < 0) || (v1 >= this.getVertexCount()) || (v2 < 0) || (v2 >= this.getVertexCount())) {
    return;
  }
  var from = this.getVertex(v1);
  var to = this.getVertex(v2);
  if (from.equals(to)) {
    return 0;
  }
  var lat1 = from.latRadians();
  var lon1 = from.lngRadians();
  var lat2 = to.latRadians();
  var lon2 = to.lngRadians();
  var angle = - Math.atan2( Math.sin( lon1 - lon2 ) * Math.cos( lat2 ), Math.cos( lat1 ) * Math.sin( lat2 ) - Math.sin( lat1 ) * Math.cos( lat2 ) * Math.cos( lon1 - lon2 ) );
  if ( angle < 0.0 ) angle  += Math.PI * 2.0;
  angle = angle * 180.0 / Math.PI;
  return parseFloat(angle.toFixed(1));
}




// === Copy all the above functions to GPolyline ===
GPolyline.prototype.Contains             = GPolygon.prototype.Contains;
GPolyline.prototype.Area                 = GPolygon.prototype.Area;
GPolyline.prototype.Distance             = GPolygon.prototype.Distance;
GPolyline.prototype.Bounds               = GPolygon.prototype.Bounds;
GPolyline.prototype.GetPointAtDistance   = GPolygon.prototype.GetPointAtDistance;
GPolyline.prototype.GetIndexAtDistance   = GPolygon.prototype.GetIndexAtDistance;
GPolyline.prototype.Bearing              = GPolygon.prototype.Bearing;


// my code starts here
// above code used for animation of certain pages.



//<![CDATA[    

// end of all pages.
var maxI = 21;
var directionsPanel;
var directions;
var oldI = 0;
var newI = 0;

// create some specific icons
var baseIcon = new GIcon();
baseIcon.iconSize=new GSize(32,32);
baseIcon.shadowSize=new GSize(56,32);
baseIcon.iconAnchor=new GPoint(16,32);
baseIcon.infoWindowAnchor=new GPoint(16,0);

// the actual icons to be used
var explosion = new GIcon(baseIcon, "http://www.highcarbbooks.com/images/maps/firedept.png", null, "http://www.highcarbbooks.com/images/maps/firedept.shadow.png");
var allied = new GIcon(baseIcon, "http://www.highcarbbooks.com/images/maps/blue-dot.png", null, "http://www.google.com/mapfiles/shadow50.png");
var planeleft   = new GIcon(baseIcon, "http://www.highcarbbooks.com/images/maps/planeleft.png", null, "http://www.highcarbbooks.com/images/maps/plane.shadow.png");
var pushpin = new GIcon(baseIcon, "http://maps.google.com/mapfiles/kml/pal5/icon14.png", null, "http://maps.google.com/mapfiles/kml/pal5/icon14s.png");

 	// back and next buttons on the map
	// start with the buttons
	// add the next and back to it.
	// use a listener to do the nextback function
	// update the two variables that hold the 
	function NextButtonControl() {
	}
	
	NextButtonControl.prototype = new GControl();

	// Creates a one DIV for each of the buttons and places them in a container
	// DIV which is returned as our control element. We add the control to
	// to the map container and return the element for the map class to
	// position properly.
	NextButtonControl.prototype.initialize = function(map) 
	{

		var container = document.createElement("div");
		var nextButtonDiv = document.createElement("div");
		this.setButtonStyle_(nextButtonDiv);
		container.appendChild(nextButtonDiv);
		nextButtonDiv.appendChild(document.createTextNode("Next"));
		GEvent.addDomListener(nextButtonDiv, "click", function()
		{
			if (maxI == newI)
			{
				alert("That's all for now, check back later!");
			} 
			else
			{
				loadMapData(newI);
			}
		});
	

		map.getContainer().appendChild(container);
		return container;
	}
	NextButtonControl.prototype.getDefaultPosition = function()
	{
		return new GControlPosition(G_ANCHOR_BOTTOM_RIGHT, new GSize(7,7));
	}

	// Sets the proper CSS for the given button element.
    	NextButtonControl.prototype.setButtonStyle_ = function(button) 
	{
      		button.style.textDecoration = "underline";
		button.style.color = "#0000cc";
      		button.style.backgroundColor = "white";
	      	button.style.font = "small Arial";
	        button.style.border = "1px solid black";
	        button.style.padding = "1px";
	        button.style.marginBottom = "2px";
	        button.style.textAlign = "center";
		button.style.width = "6em";
		button.style.cursor = "pointer";
	}
	function BackButtonControl() {
	}
	
	BackButtonControl.prototype = new GControl();

	// Creates a one DIV for each of the buttons and places them in a container
	// DIV which is returned as our control element. We add the control to
	// to the map container and return the element for the map class to
	// position properly.
	BackButtonControl.prototype.initialize = function(map) 
	{

		var container = document.createElement("div");
		var backtButtonDiv = document.createElement("div");
		this.setButtonStyle_(backtButtonDiv);
		container.appendChild(backtButtonDiv);
		backtButtonDiv.appendChild(document.createTextNode("Back"));
		GEvent.addDomListener(backtButtonDiv, "click", function()
		{
			if (oldI < 0)
			{
				alert("You have reached the beginning of the book!");
			}
			else
			{
				loadMapData(oldI);
			}
		});
	

		map.getContainer().appendChild(container);
		return container;
	}
	BackButtonControl.prototype.getDefaultPosition = function()
	{
		return new GControlPosition(G_ANCHOR_BOTTOM_LEFT, new GSize(7,7));
	}

	// Sets the proper CSS for the given button element.
    	BackButtonControl.prototype.setButtonStyle_ = function(button) 
	{
      		button.style.textDecoration = "underline";
		button.style.color = "#0000cc";
      		button.style.backgroundColor = "white";
	      	button.style.font = "small Arial";
	        button.style.border = "1px solid black";
	        button.style.padding = "1px";
	        button.style.marginBottom = "2px";
	        button.style.textAlign = "center";
		button.style.width = "6em";
		button.style.cursor = "pointer";
	}
	function AnimateButtonControl() {
	}
	
	AnimateButtonControl.prototype = new GControl();

	// Creates a one DIV for each of the buttons and places them in a container
	// DIV which is returned as our control element. We add the control to
	// to the map container and return the element for the map class to
	// position properly.
	AnimateButtonControl.prototype.initialize = function(map) 
	{

		var container = document.createElement("div");
		var backtButtonDiv = document.createElement("div");
		this.setButtonStyle_(backtButtonDiv);
		container.appendChild(backtButtonDiv);
		backtButtonDiv.appendChild(document.createTextNode("Animation"));
		

		map.getContainer().appendChild(container);
		return container;
	}
	AnimateButtonControl.prototype.getDefaultPosition = function()
	{
		return new GControlPosition(G_ANCHOR_TOP_LEFT, new GSize(7,7));
	}

	// Sets the proper CSS for the given button element.
    	AnimateButtonControl.prototype.setButtonStyle_ = function(button) 
	{
      		button.style.textDecoration = "none";
		button.style.color = "#0000cc";
      		button.style.backgroundColor = "yellow";
	      	button.style.font = "small Arial";
	        button.style.border = "1px solid black";
	        button.style.padding = "1px";
	        button.style.marginBottom = "2px";
	        button.style.textAlign = "center";
		button.style.width = "6em";
		button.style.cursor = "pointer";
	}

	var anbctr = new AnimateButtonControl();
// create the init 
function initialize()
{
	// variable to hold the toc.
	var side_bar_html = "";


	// variables to hold the html text on the page.
	var chapter_html = "";
	var story_html = "";
	var blogPost_html = "";
	var side_html ="";
    	var title_html="";
	var link_html  ="";
	var category_html = "";
	var characters_html = "";
	var ads_html="";

	// first check compatibility
	if (GBrowserIsCompatible()) 
	{
		// add google map code here

		// load the sidebar with information about the TOC.
		loadSideBar();

      		// create the map
		this.map = new GMap2(document.getElementById("map"));

		this.map.addControl(new GLargeMapControl());
	      	
		// set center of map in this case Nizhnevartovsk.
		this.map.setCenter(new GLatLng(60.933101,76.517715), 12);

	
		// load the first map and html from the switch statement
		loadMapData(0);	

		// set up the next and back buttons
		NextBack(0);

		// set up as satellite image.
		this.map.setMapType(G_SATELLITE_MAP);
		this.map.addControl(new NextButtonControl());
		this.map.addControl(new BackButtonControl());
	
	}
	else
	{
		// incompatible browser
		alert("Sorry, the Google Maps API is not compatible with this browser");	
	}
	
}
function loadSideBar()
{
	// Create sidebar with the table of content.
	// Make sure that it can load the mapdata based on numbers.
	// open with toc 
	// make the chapters bold!!!!
	side_bar_html = '<h2>T.O.C.</h2>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><b><a href="javascript:loadMapData(0)">Chapter 1</a></b></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(0)">Nizhnevartovsk, USSR</a></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(1)">Azerbaijan</a></li>';
	side_bar_html += '</ul>';
	side_bar_html += '<li><a href="javascript:loadMapData(2)">Sunnyvale, CA. USA</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(3)">Cheyenne Mountain, USA</a></li>';
	side_bar_html += '</ul>';
	side_bar_html += '<li><b><a href="javascript:loadMapData(4)">Chapter 2</a></b></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(4)">Flight back to Moscow</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(5)">To the Kremlin</a></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(6)">Report to Polit Buro</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(7)">Siberia</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(8)">Baku</a></li>';
	side_bar_html += '</ul>';
	side_bar_html += '<li><a href="javascript:loadMapData(9)">Fort Meade, Maryland</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(10)">The Kremlin, Moscow</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(11)">The Persian Gulf</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(12)">NATO</a></li>';
	side_bar_html += '</ul>';
	side_bar_html += '<li><b><a href="javascript:loadMapData(13)">Chapter 3</a></b></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(13)">Russian Army</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(14)">Norfolk, VA</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(15)">Krasnokazarmennaya Ulitsa, Moscow</a></li>';
	side_bar_html += '</ul>';
	side_bar_html += '<li><b><a href="javascript:loadMapData(16)">Chapter 4</a></b></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(16)">Maskirovka</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(17)">Bob Toland</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(18)">Kiev, The Ukraine</a></li>';
	side_bar_html += '</ul>';
	side_bar_html += '<li><b><a href="javascript:loadMapData(19)">Chapter 5</a></b></li>';
	side_bar_html += '<ul id="sideBar">';
	side_bar_html += '<li><a href="javascript:loadMapData(19)">The Chesapeake Bay</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(20)">Pearl Harbour</a></li>';
	side_bar_html += '<li><a href="javascript:loadMapData(21)">Carpathian Military District</a></li>';
	side_bar_html += '</ul>';
	// drop everything in the side_bar_html div
	document.getElementById("side_bar").innerHTML= side_bar_html;
}


function displayHTML()
	{
	
	// displays all the data in the _html variables
	document.getElementById("chapter").innerHTML = chapter_html;
	document.getElementById("story").innerHTML = story_html;
	document.getElementById("blog").innerHTML = blogPost_html;
	document.getElementById("side").innerHTML = side_html;
	document.getElementById("dispTitle").innerHTML= title_html;
	document.getElementById("dispLink").innerHTML= link_html;
	document.getElementById("category").innerHTML= category_html;
	document.getElementById("characters").innerHTML = characters_html;
	document.getElementById("mapads").innerHTML = ads_html;

}

function handleErrors(){
	   if (gdir.getStatus().code == G_GEO_UNKNOWN_ADDRESS)
	     alert("No corresponding geographic location could be found for one of the specified addresses. This may be due to the fact that the address is relatively new, or it may be incorrect.\nError code: " + gdir.getStatus().code);
	   else if (gdir.getStatus().code == G_GEO_SERVER_ERROR)
	     alert("A geocoding or directions request could not be successfully processed, yet the exact reason for the failure is not known.\n Error code: " + gdir.getStatus().code);
	   
	   else if (gdir.getStatus().code == G_GEO_MISSING_QUERY)
	     alert("The HTTP q parameter was either missing or had no value. For geocoder requests, this means that an empty address was specified as input. For directions requests, this means that no query was specified in the input.\n Error code: " + gdir.getStatus().code);

	//   else if (gdir.getStatus().code == G_UNAVAILABLE_ADDRESS)  <--- Doc bug... this is either not defined, or Doc is wrong
	//     alert("The geocode for the given address or the route for the given directions query cannot be returned due to legal or contractual reasons.\n Error code: " + gdir.getStatus().code);
	     
	   else if (gdir.getStatus().code == G_GEO_BAD_KEY)
	     alert("The given key is either invalid or does not match the domain for which it was given. \n Error code: " + gdir.getStatus().code);

	   else if (gdir.getStatus().code == G_GEO_BAD_REQUEST)
	     alert("A directions request could not be successfully parsed.\n Error code: " + gdir.getStatus().code);
	    
	   else alert("An unknown error occurred.");
	   
	}

function NextBack(iValue)
{
	// two variables to move back and forth basedon iValue that is given.
	oldI = iValue - 1;
	newI = iValue + 1;
		
}

function loadMapData(iValue)
{
	
	// create the back and next buttons.
	NextBack(iValue);

	// clear previous overlays.
	map.clearOverlays();
	var infoWin = "";

	// each value will have its own map setup.
	switch(iValue)
	{
		case 0:


			// place new marker 
			var point = new GLatLng(60.933101,76.517715);
      			var marker = new GMarker(point,explosion);
			this.map.panTo(new GLatLng(60.933101,76.517715));
			this.map.setZoom(11);
			this.map.addOverlay(marker);
			
			infoWin  = 'An oil refinery near the town of Nizhnevartovsk is blown up by a group of terrorists.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 1";
			story_html = "An oil refinery near the town of Nizhnevartovsk is blown up by a group of terrorists.";
			blogPost_html = '<a href="http://www.highcarbbooks.com/?p=5">Nizhnevartovsk</a>';
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#IbrahimTolkaze">Ibrahim Tolkaze</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#Rasul">Rasul</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#Mohammet">Mohammet</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#NikolayBarsov">Nikolay Barsov</a>';
			side_html = "USSR";
			title_html = "Nizhnevartovsk";
			link_html = '<a href="http://en.wikipedia.org/wiki/Nizhnevartovsk">Town of Nizhnevartovsk</a><br /><a href="http://en.wikipedia.org/wiki/Samotlor_Field">Samotlor_Field</a><br /><a href="http://en.wikipedia.org/wiki/Oil_refinery">Oil 			Refinery</a><br /><a 			href="http://en.wikipedia.org/wiki/USSR">USSR</a><br /><a href="http://en.wikipedia.org/wiki/Russia">Rusia</a><br /><a 			href="http://en.wikipedia.org/wiki/Terrorist">Terrorist</a>';
			category_html = "USSR, Nizhnevartovsk,Oil Refinery,Terrorist";
			ads_html = '<a target="_blank" href="http://www.shareasale.com/r.cfm?b=25525&amp;u=286807&amp;m=6273&amp;urllink=&amp;afftrack="><img src="http://www.shareasale.com/image/rl_sovietlegacygifts_en.gif" border="0" /></a>';
			break;
		case 1:
			// place new marker 
			var point = new GLatLng(40.363288,47.609253);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(40.363288,47.609253));
			this.map.setZoom(8);
			this.map.addOverlay(marker);
			this.map.setMapType(G_HYBRID_MAP);
			infoWin  = 'The terrorist had an Azerbaijani background, his father was killed during an uprissing against the Soviet Union.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 1";
			story_html = "The terrorist had an Azerbaijani background. His father, who was from Azerbaijan, was killed during an uprissing against the Soviet Union. The terrorist Ibrahim Tolkaze was brought up in the Soviet Society but his grandfather made sure he kept his Islamic Faith.";
			blogPost_html = '';
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#IbrahimTolkaze">Ibrahim Tolkaze</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#Rasul">Rasul</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#Mohammet">Mohammet</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#NikolayBarsov">Nikolay Barsov</a>';
			side_html = "N/a";
			title_html = "Azerbaijan";
			link_html = '<a href="http://en.wikipedia.org/wiki/Azerbaijan">Azerbaijan</a><br /><a href="http://en.wikipedia.org/wiki/Terrorist">Terrorist</a>';
			category_html = "Azerbaijan,Terrorist";
			break;
		case 2:	

			// place new marker 
			var point = new GLatLng(37.404545,-122.027925);
      			var marker = new GMarker(point,allied);
			this.map.panTo(new GLatLng(37.404545,-122.027925));
			this.map.setZoom(16);
			this.map.addOverlay(marker);
			
			this.map.setMapType(G_SATELLITE_TYPE);
			infoWin  = 'The explosion was captured by the Onizuka Air Force Station Satellite Monitoring facilities in Sunnyvale, CA.<br /><a href="#moreinfo">More info.</a>';

			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);


			chapter_html = "Chapter 1";
			story_html = "The explosion was captured by the Onizuka Air Force Statio satellites monitoring facilities in Sunnyvale, CA.";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#ColonelBurnette">Colonel Burnette</a>';
			side_html = "Allied";
			title_html = "Sunnyvale, CA.";
			link_html = '<a href="http://en.wikipedia.org/wiki/USA">USA</a><br /><a href="http://en.wikipedia.org/wiki/Spy_satellite">Spy 					Satellite</a><br /><a href="http://en.wikipedia.org/wiki/Satellite">Satellite</a><br /><a 			href="http://en.wikipedia.org/wiki/Spy">Spy</a><br /><a href="http://en.wikipedia.org/wiki/Onizuka_Air_Force_Station">Onizuka Air 			Force Station</a><br /> <a href="http://en.wikipedia.org/wiki/KH-11">KH-11 Satellite</a>';
			category_html = "USA, Satellite, Spy, Onizuka Air Force Station, KH-11";

			break;
		case 3:

			// place new marker 
			var point = new GLatLng(38.744243,-104.846671);
      			var marker = new GMarker(point,allied);
			this.map.panTo(new GLatLng(38.744243,-104.846671));
			this.map.setZoom(18);
			this.map.addOverlay(marker);
			
			
			infoWin  = 'The explosion was reported to Cheyenne Mountain headquarters of Norad.<br/><a href="#moreinfo">More info.</a>';

			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);


			chapter_html = "Chapter 1";
			story_html = "The explosion was reported to Cheyenne Mountain headquarters of NORAD.";
			blogPost_html = "";
			characters_html = "";
			side_html = "Allied";
			title_html = "Cheyenne Mountain";
			link_html = '<a href="http://en.wikipedia.org/wiki/Cheyenne_Mountain">Cheyenne Mountain</a><br /><a href="http://www.norad.mil/">NORAD</a>';
			category_html = "USA,Cheyenne Mountain, NORAD";

			break;
		case 4:

			// animate the plane flying
			// just show the map so everything is in view
			// then start point add plane
			// etc
			// end point
			// display marker 
			// hide marker
			

			// indicate it is an animation
			this.map.addControl(anbctr);

			// add starting pointer
			var point1 = new GLatLng(60.960277,76.502609);
     			var marker1 = new GMarker(point1);
			this.map.addOverlay(marker1);

			// add ending pointer
			var point2 = new GLatLng(55.597093,37.286224);
      			var marker2 = new GMarker(point2);
			this.map.addOverlay(marker2);
			
			// add event listeners for both markers
			GEvent.addListener(marker1, "click", function()
			{
				marker1.openInfoWindowHtml("Nizhnevartovsk Airport");	
			});

			GEvent.addListener(marker2, "click", function()
			{
				marker2.openInfoWindowHtml("Vnukovo-2 Airport");	
			});
			
		
			// open the info window by default.
			marker1.openInfoWindowHtml("Nizhnevartovsk Airport");

			// set up map to display all to fit
			this.map.panTo(new GLatLng(59.80063426102869, 55.72265625));
			this.map.setZoom(4);

			// add geodesic true to arc the line (not working in animation).
			var polyOptions = {geodesic:true};
			
			var movementPolyline;
			var markerAnim=new GMarker(new GLatLng(60.953944, 76.490593),planeleft);

			var startPoint = new GLatLng(60.953944, 76.490593);
			var EndPoint= new GLatLng(55.77078, 37.804642);
			
			// set the poly line
			movementPolyline = new GPolyline([startPoint,EndPoint], "#ff0000", 5, 1, polyOptions);


			// set the marker
			markerAnim.setPoint(startPoint);

			// point needed?
			this.map.addOverlay(markerAnim);

			// take the distance out of the function
			var distance = 114724;

			var timeOutStep = 1000;
			var counter = 0;

			// Do the actual animation
			function doAnimate()
			{
				
	                	if(movementPolyline.getLength() > distance)
				{
					// first counter keep it slow, then speed it up
					// so the page can load first
					if (counter == 1)
					{
						timeOutStep= 200;
					}
					counter++;
			        	var point=movementPolyline.GetPointAtDistance(distance);
			        
					markerAnim.setPoint(point);
				
					// set new distance
				        distance+=114724;

			        	the_timeout = setTimeout(doAnimate, timeOutStep);
				}
				else // close it out and show the other airport marker.
				{
					clearTimeout(the_timeout);
					marker2.openInfoWindowHtml("Vnukovo-2 Airport");
				}
				

			} 
			// call the function to get it started
			doAnimate();


			chapter_html = "Chapter 2";
			story_html = "Mikhail Eduardovich Sergetov flew back to Moscow to present his report about the attack in Nizhnevartovsk to the 			politburo";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#mikhailsergetov">Mikhail Eduordovich Sergetov</a>';
			side_html = "USSR";
			title_html = "Flight back to Moscow";
			link_html = '<a href="http://en.wikipedia.org/wiki/Ilyushin_Il-86">Illyushin IL-86</a><br /><a href="http://en.wikipedia.org/wiki/Nizhnevartovsk">Town of Nizhnevartovsk</a><br /><a href="http://en.wikipedia.org/wiki/Moscow">Moscow</a>';
			category_html = "Mikhail Eduardovich Sergetov, Nizhnevartovsk, Moscow,Illyushin IL-86";

			break;

		case 5:

			// remove since it is not an animation;
			this.map.removeControl(anbctr);
			var point = new GLatLng(55.605021,37.289057);
      			var marker = new GMarker(point);

			this.map.panTo(new GLatLng(55.605021,37.289057));
			this.map.setZoom(3);
			this.map.addOverlay(marker);

			var point1 = new GLatLng(55.751215,37.616136);
      			var marker1 = new GMarker(point1);
			this.map.addOverlay(marker1);

			var point2 = new GLatLng(55.752592,37.623013);
      			var marker2 = new GMarker(point2);
			this.map.addOverlay(marker2);

			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml("Vnukovo-2 Airport");	
			});

			GEvent.addListener(marker1, "click", function()
			{
				marker1.openInfoWindowHtml("The Kremlin");	
			});
			
			GEvent.addListener(marker2, "click", function()
			{
				marker2.openInfoWindowHtml("Red Square");	
			});

			// open the info window by default.
			marker1.openInfoWindowHtml("The Kremlin");
			directions = new GDirections(map, directionsPanel);
			directions.load("55.605021,37.289057 to 55.751215,37.616136");


			chapter_html = "Chapter 2";
			story_html = "Mikhail Sergetov was driven from Vnukovo-2 airport directly to the Kremlin passing Red Square on the way";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#mikhailsergetov">Mikhail Eduordovich Sergetov</a>';
			side_html = "USSR";
			title_html = "From the airport to the Kremlin";
			link_html = '<a href="http://en.wikipedia.org/wiki/Vnukovo_International_Airport">Vnukovo Airport</a><br /><a href="http://en.wikipedia.org/wiki/Moscow_Kremlin">The Kremlin</a><br/><a href="http://en.wikipedia.org/wiki/Red_Square">Red Square</a><br /><a href="http://en.wikipedia.org/wiki/Moscow">Moscow</a><br /><a href="http://en.wikipedia.org/wiki/Council_of_Ministers_of_the_USSR">Council of Ministers</a><br /><a href="http://en.wikipedia.org/wiki/Politburo">Politburo</a><br /><a href="http://www.amo-zil.ru/zil_eng/66.html#view">Zil limousine</a>';
			category_html = "Mikhail Eduardovich Sergetov, Vnukovo-2,Airport, , Red Square, The Kremlin,Council of Ministers,Politburo,Moscow, Zil Limousine";

			break;
		case 6:
			// place new marker 
			var point = new GLatLng(55.751215,37.616136);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(55.751215,37.616136));
			this.map.setZoom(16);
			this.map.addOverlay(marker);
			
			infoWin  = 'The Politburo heard what Mikhail Sergetov had to say about the terrorist attack.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 2";
			story_html = "The Politburo heard what Mikhail Sergetov had to say about the terrorist attack.";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#mikhailsergetov">Mikhail Eduordovich Sergetov</a>';
			side_html = "USSR";
			title_html = "The Kremlin";
			link_html = '<a href="http://en.wikipedia.org/wiki/Moscow_Kremlin">The Kremlin</a><br/><a href="http://en.wikipedia.org/wiki/Moscow">Moscow</a><br /><a href="http://en.wikipedia.org/wiki/Council_of_Ministers_of_the_USSR">Council of Ministers</a><br /><a href="http://en.wikipedia.org/wiki/Politburo">Politburo</a>';
			category_html = "USSR, Politburo, The Kremlin, Moscow";
			break;
		case 7:
			// siberia
			// place new marker 
			var point = new GLatLng(60.000016,105.000114);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(60.000016,105.000114));
			this.map.setZoom(8);
			this.map.addOverlay(marker);
			
			infoWin  = 'Mikhail Sergetov explains that the workers for the oil fields are recruited all the way from Siberia to the Baku Region.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 2";
			story_html = "Mikhail Sergetov explains that the workers for the oil fields are recruited all the way from Siberia to the Baku Region";
			blogPost_html = '';
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#mikhailsergetov">Mikhail Eduordovich Sergetov</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#IbrahimTolkaze">Ibrahim Tolkaze</a>';
			side_html = "N/a";
			title_html = "Siberia";
			link_html = '<a href="http://en.wikipedia.org/wiki/Siberia">Siberia</a>';
			category_html = "Siberia";
			break;
			
		case 8:
			// baku		
			// place new marker 
			var point = new GLatLng(40.383428,49.893208);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(40.383428,49.893208));
			this.map.setZoom(14);
			this.map.addOverlay(marker);
			
			infoWin  = 'Mikhail Sergetov explains that the workers for the oil fields are recruited all the way from Siberia to the Baku Region.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 2";
			story_html = "Mikhail Sergetov explains that the workers for the oil fields are recruited all the way from Siberia to the Baku Region";
			blogPost_html = '';
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#mikhailsergetov">Mikhail Eduordovich Sergetov</a><br /><a href="http://www.highcarbbooks.com/?page_id=38#IbrahimTolkaze">Ibrahim Tolkaze</a>';
			side_html = "N/a";
			title_html = "Baku";
			link_html = '<a href="http://en.wikipedia.org/wiki/Azerbaijan">Azerbaijan</a><br /><a href="http://en.wikipedia.org/wiki/Baku">Baku</a>';
			category_html = "Azerbaijan,Baku";
			break;
		case 9:

			// place new marker 
			var point = new GLatLng(39.108901,-76.77186);
      			var marker = new GMarker(point, allied);
			this.map.panTo(new GLatLng(39.108901,-76.77186));
			this.map.setZoom(17);
			this.map.addOverlay(marker);
			
			infoWin  = 'Fort Meade, Maryland. Headquarters of the N.S.A.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 2";
			story_html = "Fort Meade, Maryland. Headquarters of the N.S.A. Bob Toland a security analyst for the N.S.A., discusses the impact the destroyed oil field will have on the USSR economy. with a colleague.";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#bobtoland">Bob Toland</a>';
			side_html = "Allied";
			title_html = "Fort Meade, Maryland.";
			link_html = '<a href="http://www.nsa.gov/">N.S.A</a><br /><a href="http://en.wikipedia.org/wiki/National_Security_Agency">National Security Agency</a><br /><a href="http://en.wikipedia.org/wiki/Fort_Meade">Fort Meade</a><br /><a href="http://en.wikipedia.org/wiki/Maryland">Maryland</a>';
			category_html = "USA, Allied, N.S.A, Fort Meade, Maryland";
			break;

		case 10:
			// place new marker 
			var point = new GLatLng(55.751215,37.616136);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(55.751215,37.616136));
			this.map.setZoom(16);
			this.map.addOverlay(marker);
			
			infoWin  = 'The Politburo reconvened to discuss what to do next.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 2";
			story_html = "The Politburo reconvened to discuss what to do about the shortage of oil.";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#mikhailsergetov">Mikhail Eduordovich Sergetov</a>';
			side_html = "USSR";
			title_html = "The Kremlin";
			link_html = '<a href="http://en.wikipedia.org/wiki/Moscow_Kremlin">The Kremlin</a><br/><a href="http://en.wikipedia.org/wiki/Moscow">Moscow</a><br /><a href="http://en.wikipedia.org/wiki/Council_of_Ministers_of_the_USSR">Council of Ministers</a><br /><a href="http://en.wikipedia.org/wiki/Politburo">Politburo</a><br /><a href="http://en.wikipedia.org/wiki/Military_deception">maskirovka</a><br /><a href="http://en.wikipedia.org/wiki/KGB">KGB</a>';
			category_html = "USSR, Politburo, The Kremlin, Moscow";
			break;

		case 11:
			//place new marker
			var point = new GLatLng(26.88288,53.195801);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(26.88288,53.195801));
			this.map.setZoom(5);
			this.map.addOverlay(marker);

			infoWin  = 'Lots of oil is available in the Persian Gulf.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html ="Chapter 2";
			story_html = "Lots of oil is available in the Persian Gulf.";
			blogPost_html = "";
			characters_html = "";
			side_html = "USSR";
			title_html = "The Persian Gulf";
			link_html = '<a href="http://en.wikipedia.org/wiki/Persian_Gulf">The Persian Gulf</a><br/><a href="http://en.wikipedia.org/wiki/Oil">Oil</a>';
			category_html = "Oil, Persian Gulf";
			break;
		case 12:
			//place new marker
			var point = new GLatLng(50.874204,4.430103);
      			var marker = new GMarker(point,allied);
			this.map.panTo(new GLatLng(50.874204,4.430103));
			this.map.setZoom(16);
			this.map.addOverlay(marker);

			infoWin  = 'Before the USSR can take the oil they will have to deal with NATO.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 2";
			story_html = "Before the USSR can take the oil from the Persian Gulf, they will have to deal with NATO. Map shows NATO headquarters in Belgium";
			blogPost_html = "";
			characters_html = "";
			side_html = "Allied";
			title_html = "NATO";
			link_html = '<a href="http://www.nato.int/">NATO</a><br/><a href="http://en.wikipedia.org/wiki/NATO">NATO</a><br /><a href="http://en.wikipedia.org/wiki/Belgium">Belgium</a>';
			category_html = "NATO, Headquarters, Belgium";
			break;
		case 13:
			// place new marker 
			var point = new GLatLng(55.751215,37.616136);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(55.751215,37.616136));
			this.map.setZoom(16);
			this.map.addOverlay(marker);
			
			infoWin  = 'After the Politburo decided to invade Europe and the Persian Gulf, it is up to the Military to plan and excute the attack.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 3";
			story_html = "After the Politburo decided to invade Europe and the Persian Gulf, it is up to the Military to plan and excute the attack.";
			blogPost_html = "";
			characters_html = "";
			side_html = "USSR";
			title_html = "Russian Army";
			link_html = '<a href="http://en.wikipedia.org/wiki/Red_Army">Red Army</a><br /><a href="http://en.wikipedia.org/wiki/Russian_Army">Russian Army</a><br /><a href="http://en.wikipedia.org/wiki/General_of_the_Army_(Russia)">General of the Army</a><br /><a href="http://en.wikipedia.org/wiki/Commander_in_chief">Commander in Chief</a>';
			category_html = "USSR, Moscow, Russian Army, Army Marshall, General of the Army, Commander in Chief";
			break;

		case 14:
			// place new marker 
			var point = new GLatLng(36.937544,-76.302001);
      			var marker = new GMarker(point,allied);
			this.map.panTo(new GLatLng(36.937544,-76.302001));
			this.map.setZoom(12);
			this.map.addOverlay(marker);

			var point1 = new GLatLng(36.93802,-76.33267);
			var marker1 = new GMarker(point1,allied);
			this.map.addOverlay(marker1);			

			
			infoWin  = 'Norfolk Virginia, Home of the USS Chicago<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});

			GEvent.addListener(marker1, "click", function()
			{
				marker1.openInfoWindowHtml("Submarine docks");	
			});
	      	
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 3";
			story_html = "Norfolk Virginia, Home of the USS Chicago a Los Angeles class attack submarine";
			blogPost_html = "";
			characters_html = "";
			side_html = "Allied";
			title_html = "Norfolk Virginia";
			link_html = '<a href="http://www.navstanorva.navy.mil/">Naval Station Norfolk</a><br /><a href="http://en.wikipedia.org/wiki/Norfolk,_Virginia">Norfolk, Virginia</a><br /><a href="http://en.wikipedia.org/wiki/USS_Chicago_(SSN-721)">USS Chicago SSN-721</a><br /><a href="http://en.wikipedia.org/wiki/Los_Angeles_class_submarine">Los angeles Class Submarine</a>';
			category_html = "USA,Norfolk Virginia , Naval Station Norfolk,USS Chicago SSN-721, Submarine, Los Angeles Class";
			break;

		case 15:
	
			// place new marker 
			var point = new GLatLng(55.75913,37.691474);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(55.75913,37.691474));
			this.map.setZoom(15);
			this.map.addOverlay(marker);


			
			infoWin  = 'Krasnokazarmennaya Ulitsa, Moscow, Main officers club of the Moscow Military District<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});

			
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 3";
			story_html = "Krasnokazarmennaya Ulitsa, Moscow, Main officers club of the Moscow Military District. All senior commanders of the Russian military were present to hear about the attack on Western Europe.";
			blogPost_html = "";
			characters_html = "";
			side_html = "USSR";
			title_html = "Krasnokazarmennaya Ulitsa, Moscow";
			link_html = '<a href="http://en.wikipedia.org/wiki/Moscow_Military_District">Moscow Military District</a>';
			category_html = "USSR, Moscow Military District, Officers Club";
			break;
		case 16:
			// place new marker 
			var point = new GLatLng(55.751215,37.616136);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(55.751215,37.616136));
			this.map.setZoom(16);
			this.map.addOverlay(marker);
			
			infoWin  = 'The Russian Foreign Minister explained to the foreign press the plans to reduce the nuclear arms inventory.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 4";
			story_html = "The Russian Foreign Minister explained to the foreign press the plans to reduce the nuclear arms inventory.";
			blogPost_html = "";
			characters_html = "";
			side_html = "USSR";
			title_html = "Maskirovka";
			link_html = '<a href="http://en.wikipedia.org/wiki/Military_deception">maskirovka</a>';
			category_html = "USSR, Politburo, The Kremlin, Moscow";
			break;

		case 17:
			// place new marker 
			var point = new GLatLng(39.108901,-76.77186);
      			var marker = new GMarker(point, allied);
			this.map.panTo(new GLatLng(39.108901,-76.77186));
			this.map.setZoom(17);
			this.map.addOverlay(marker);
			
			infoWin  = 'Bob Toland reviewed the news report on the reduction in nuclear arms proposed by the Russians<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 4";
			story_html = "Bob Toland reviewed the news report on the reduction in nuclear arms proposed by the Russians";
			blogPost_html = "";
			characters_html = '<a href="http://www.highcarbbooks.com/?page_id=38#bobtoland">Bob Toland</a>';
			side_html = "Allied";
			title_html = "Bob Toland";
			link_html = '<a href="http://en.wikipedia.org/wiki/Yankee_class_submarine">Yankee class submarine</a>';
			category_html = "USA, Allied, N.S.A, Fort Meade, Maryland";
			break;

		case 18:
			// place new marker 
			var point = new GLatLng(50.444453,30.529112);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(50.444453,30.529112));
			this.map.setZoom(17);
			this.map.addOverlay(marker);
			
			infoWin  = 'At the Headquarters of the Kiev Military District Alekseyev explains there is a lot of work to do still.<br /><a href="#moreinfo">More info.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 4";
			story_html = "At the Headquarters of the Kiev Military District Alekseyev explains there is a lot of work to do still.";
			blogPost_html = "";
			characters_html = 'Alekseyev';
			side_html = "USSR";
			title_html = "Kiev";
			link_html = '';
			category_html = 'USSR, Kiev Military District';
			break;

		case 19:
			// place new marker 
			var point = new GLatLng(38.621162,-76.431885);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(38.621162,-76.431885));
			this.map.setZoom(8);
			this.map.addOverlay(marker);
			
			infoWin  = 'Bob Toland and his father-in-law Edward Keegan, a DIA (Defense Intelegency Agency) employee and former Navy officer, are fishing on Chesapeake Bay, and discussing the odd things happening in Russia.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 5";
			story_html = "Bob Toland and his father-in-law Edward Keegan, a DIA (Defense Intelegency Agency) employee and former Navy officer, are fishing on Chesapeake Bay, and discussing the odd things happening in Russia.";
			blogPost_html = "";
			characters_html = 'Bob Toland, Edward Keegan';
			side_html = "Allied";
			title_html = "The Chesapeake Bay, Maryland";
			link_html = '';
			category_html = "USA, Allied, N.S.A, D.I.A, Edward Keegan, Navy";
			break;

		case 20:
			// place new marker 
			var point = new GLatLng(21.359015,-157.949238);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(21.359015,-157.949238));
			this.map.setZoom(15);
			this.map.addOverlay(marker);
			
			infoWin  = 'Bob Toland first met his future wife Martha when he was stationed at Pearl Harbour.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 5";
			story_html = "Bob Toland first met his future wife Martha when he was stationed at Pearl Harbour.";
			blogPost_html = "";
			characters_html = 'Bob Toland, Martha Keegan';
			side_html = "Allied";
			title_html = "Pearl Harbour, Hawaii";
			link_html = '';
			category_html = "USA, Allied, Bob Toland, Martha Keegan, Hawaii, Pearl Harbour";
			break;
case 21:
			// place new marker 
			var point = new GLatLng(48.563885,23.933716);
      			var marker = new GMarker(point);
			this.map.panTo(new GLatLng(48.563885,23.933716));
			this.map.setZoom(8);
			this.map.addOverlay(marker);
			
			infoWin  = 'Four colonels from the Carpathian Military District were Court-martialed and executed.</a>'
			GEvent.addListener(marker, "click", function()
			{
				marker.openInfoWindowHtml(infoWin);	
			});
	      	
			// open the info window by default.
			marker.openInfoWindowHtml(infoWin);

			chapter_html = "Chapter 5";
			story_html = "Four colonels from the Carpathian Military District were Court-martialed and executed. This was for falsifying readiness reports.";
			blogPost_html = "";
			characters_html = 'Bob Toland, Edward Keegan';
			side_html = "Allied, USSR";
			title_html = "Carpathian Military District";
			link_html = '<a href="http://en.wikipedia.org/wiki/Carpathian_Military_District">Carpathian Military District</a>';
			category_html = "USSR,Four Colonels, Carpathian Military District, Bob Toland,Edward Keegan";
			break;


		default:
			alert('oops, something went wrong. So Sorry!!');

	}	

	// display html;
	displayHTML();

}
//]]>


