var expanded = 0;
var content_counter = 0;
var end = false;
var forw = true;
var max_num = 0;
var story_count = 1;
function stories( num )
{
	if( num == 0 )
	{
		if( story_count > 1 )
		{
			story_count--;
		}
	}
	else if( num == 10 )
	{
		if( story_count < 3 )
		{
			story_count++;
		}
	}
	else
	{
		story_count = num;
	}
	if( story_count == 1 )
	{
		tmpText = "<div class=\"story_header\"><a href=\"http://www.prnewswire.com/news-releases/sustainx-names-thomas-zarrella-president-ceo-and-director-97877149.html\" target=\"_blank\" style=\"text-decoration:none\">Thomas Zarella Named CEO</a></div><div class=\"story_location\">July 6, 2010 &mdash; PR Newswire</div><div class=\"story_excerpt\">SustainX, Inc., has announced that Thomas M. Zarrella will oversee its transition from the R&amp;D phase to commercialization...</div><div class=\"read_more\"><a href=\"http://www.prnewswire.com/news-releases/sustainx-names-thomas-zarrella-president-ceo-and-director-97877149.html\" target=\"_blank\" style=\"text-decoration:none\">READ MORE</a></div><div id=\"news_midline\"></div><div class=\"story_header\"><a href=\"http://www.prnewswire.com/news-releases/sustainx-finalizes-54m-of-funding-from-us-doe-96906854.html\" target=\"_blank\" style=\"text-decoration:none\">SustainX Finalizes $5.4M</a></div><div class=\"story_location\">June 22, 2010 &mdash; PR Newswire</div><div class=\"story_excerpt\">SustainX, Inc. has finalized a $5.4 million award by the U.S. Department of Energy under a federal program...</div><div class=\"read_more\"><a href=\"http://www.prnewswire.com/news-releases/sustainx-finalizes-54m-of-funding-from-us-doe-96906854.html\" target=\"_blank\" style=\"text-decoration:none\">READ MORE</a></div><div id=\"prev_next_story\">(1)&nbsp;&nbsp;<a href=\"javascript:stories(2)\">2</a>&nbsp;&nbsp;<a href=\"javascript:stories(3)\">3</a></div><div id=\"prev_next_button\"><a href=\"javascript:stories(0)\">prev</a> / <a href=\"javascript:stories(10)\">next</a></div>";
	}
	else if( story_count == 2 )
	{
		tmpText = "<div class=\"story_header\"><a href=\"http://www.pehub.com/67715/vcj-20-most-promising-startups-the-full-list/\" target=\"_blank\" style=\"text-decoration:none\">SustainX among top 20 startups</a></div><div class=\"story_location\">Mar. 30, 2010 &mdash; peHUB</div><div class=\"story_excerpt\">SustainX tied for 10th place on the list of winners of the VCJ 20 Most Promising Startups available...</div><div class=\"read_more\"><a href=\"http://www.pehub.com/67715/vcj-20-most-promising-startups-the-full-list/\" target=\"_blank\" style=\"text-decoration:none\">READ MORE</a></div><div id=\"news_midline\"></div><div class=\"story_header\"><a href=\"http://shaheen.senate.gov/news/press/release/?id=3863FAD6-FD66-4850-A2A3-757F4ABBF151\" target=\"_blank\" style=\"text-decoration:none\">Senator Shaheen visits SustainX</a></div><div class=\"story_location\">Feb. 26, 2010 &mdash; Jeanne Shaheen</div><div class=\"story_excerpt\">U.S. Senator Jeanne Shaheen today called for greater investment in clean energy technologies during a visit to SustainX...</div><div class=\"read_more\"><a href=\"http://shaheen.senate.gov/news/press/release/?id=3863FAD6-FD66-4850-A2A3-757F4ABBF151\" target=\"_blank\" style=\"text-decoration:none\">READ MORE</a></div><div id=\"prev_next_story\"><a href=\"javascript:stories(1)\">1</a>&nbsp;&nbsp;(2)&nbsp;&nbsp;<a href=\"javascript:stories(3)\">3</a></div><div id=\"prev_next_button\"><a href=\"javascript:stories(0)\">prev</a> / <a href=\"javascript:stories(10)\">next</a></div>";
	}
	else if( story_count == 3 )
	{
		tmpText = "<div class=\"story_header\"><a href=\"http://www.prnewswire.com/news-releases/energy-storage-startup-sustainx-receives-54m-from-doe-73687797.html\" target=\"_blank\" style=\"text-decoration:none\">SustainX Receives $5.4M from DOE</a></div><div class=\"story_location\">Nov. 25, 2009 &mdash; PR Newswire</div><div class=\"story_excerpt\">SustainX, Inc., a startup developing a new technology for utility-scale energy storage, has received a $5.39 million award...</div><div class=\"read_more\"><a href=\"http://www.prnewswire.com/news-releases/energy-storage-startup-sustainx-receives-54m-from-doe-73687797.html\" target=\"_blank\" style=\"text-decoration:none\">READ MORE</a></div><div id=\"news_midline\"></div><div class=\"story_header\"><a href=\"http://earth2tech.com/2009/11/24/5-energy-storage-players-that-won-smart-grid-stimulus-funds/\" target=\"_blank\" style=\"text-decoration:none\">Smart Grid Stimulus Funds</a></div><div class=\"story_location\">Nov. 24, 2009 &mdash; earth2tech</div><div class=\"story_excerpt\">SustainX, Inc., a local startup developing new technology for utility-scale energy storage has received a $5.4 million grant from the DOE...</div><div class=\"read_more\"><a href=\"http://earth2tech.com/2009/11/24/5-energy-storage-players-that-won-smart-grid-stimulus-funds/\" target=\"_blank\" style=\"text-decoration:none\">READ MORE</a></div><div id=\"prev_next_story\"><a href=\"javascript:stories(1)\">1</a>&nbsp;&nbsp;<a href=\"javascript:stories(2)\">2</a>&nbsp;&nbsp;(3)&nbsp;&nbsp;</a></div><div id=\"prev_next_button\"><a href=\"javascript:stories(0)\">prev</a> / <a href=\"javascript:stories(10)\">next</a></div>"
	}
	document.getElementById( 'news_box' ).innerHTML = tmpText;
}

function toGreen( num, e, pageName )
{
	if( pageName == 'applications' )
	{
		app_linename = 'app_green_line';
		app_textname = 'app_green';
	}
	else
	{
		app_linename = 'app_blue_line';
		app_textname = 'app_blue';
	}
	if( pageName == 'financial' )
	{
		fin_linename = 'fin_green_line';
		fin_textname = 'fin_green';
	}
	else
	{
		fin_linename = 'fin_blue_line';
		fin_textname = 'fin_blue';
	}
	if( pageName == 'company' )
	{
		comp_linename = 'comp_green_line';
		comp_textname = 'comp_green';
	}
	else
	{
		comp_linename = 'comp_blue_line';
		comp_textname = 'comp_blue';
	}
	if( num == 1 )
	{
		document.getElementById( 'home_blue_line' ).style.backgroundImage = 'url(images/home_green_line.png)';
	}
	else if( num == 2 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		if( expanded === 0 )
		{
			document.getElementById( 'over_blue' ).style.visibility = 'visible';
			document.getElementById( 'over_blue_line' ).style.visibility = 'visible';
			document.getElementById( 'thermo_blue' ).style.visibility = 'visible';
			document.getElementById( 'thermo_blue_line' ).style.visibility = 'visible';
			document.getElementById( 'our_blue' ).style.visibility = 'visible';
			document.getElementById( 'our_blue_line' ).style.visibility = 'visible';
			document.getElementById( 'adv_blue' ).style.visibility = 'visible';
			document.getElementById( 'adv_blue_line' ).style.visibility = 'visible';
			if( pageName == 'applications' )
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext1.png)';
			}
			else
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext1.png)';
			}
			document.getElementById( app_linename ).style.height = 197 + 'px';
			document.getElementById( app_textname ).style.paddingTop = 187 + 'px';
			if( pageName == 'financial' )
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext1.png)';
			}
			else
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext1.png)';
			}
			document.getElementById( fin_linename ).style.height = 240 + 'px';
			document.getElementById( fin_textname ).style.paddingTop = 230 + 'px';
			document.getElementById( fin_linename ).style.marginTop = -192 + 'px';
			if( pageName == 'company' )
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext1.png)';
			}
			else
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext1.png)';
			}
			document.getElementById( comp_linename ).style.height = 283 + 'px';
			document.getElementById( comp_textname ).style.paddingTop = 273 + 'px';
			document.getElementById( comp_linename ).style.marginTop = -235 + 'px';
			expanded = 1;
		}
	}
	else if( num == 21 )
	{
		document.getElementById( 'over_blue_line' ).style.backgroundImage = 'url(images/over_green_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
	}
	else if( num == 22 )
	{
		if( expanded == 1 )
		{
			expanded = 2;
			document.getElementById( 'box1' ).style.height = 185 + 'px';
			document.getElementById( 'box1' ).style.width = 140 + 'px';
			document.getElementById( 'tech_blue' ).style.marginTop = -179 + 'px';
		}
		else if( expanded == 3 )
		{
			expanded = 4;
			document.getElementById( 'box1' ).style.height = 230 + 'px';
			document.getElementById( 'box1' ).style.width = 140 + 'px';
			document.getElementById( 'tech_blue' ).style.marginTop = -224 + 'px';
		}
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_green_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'thermo101_blue' ).style.visibility = 'visible';
		document.getElementById( 'thermo101_blue_line' ).style.visibility = 'visible';
		document.getElementById( 'caes_blue' ).style.visibility = 'visible';
		document.getElementById( 'caes_blue_line' ).style.visibility = 'visible';
		document.getElementById( 'iso_blue' ).style.visibility = 'visible';
		document.getElementById( 'iso_blue_line' ).style.visibility = 'visible';
		document.getElementById( 'cogen_blue' ).style.visibility = 'visible';
		document.getElementById( 'cogen_blue_line' ).style.visibility = 'visible';
		document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line_ext2.png)';
		document.getElementById( 'our_blue_line' ).style.height = 131 + 'px';
		document.getElementById( 'our_blue' ).style.paddingTop = 122 + 'px';
		document.getElementById( 'our_blue_line' ).style.marginTop = -46 + 'px';
		if( expanded == 2 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext2.png)';
			document.getElementById( 'adv_blue_line' ).style.height = 151 + 'px';
			document.getElementById( 'adv_blue' ).style.paddingTop = 142 + 'px';
			document.getElementById( 'adv_blue_line' ).style.marginTop = -131 + 'px';
			if( pageName == 'applications' )
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext2.png)';
			}
			else
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext2.png)';
			}
			document.getElementById( app_linename ).style.height = 262 + 'px';
			document.getElementById( app_textname ).style.paddingTop = 252 + 'px';
			document.getElementById( app_linename ).style.marginTop = -80 + 'px';
			if( pageName == 'financial' )
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext2.png)';
			}
			else
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext2.png)';
			}
			document.getElementById( fin_linename ).style.height = 305 + 'px';
			document.getElementById( fin_textname ).style.paddingTop = 295 + 'px';
			document.getElementById( fin_linename ).style.marginTop = -257 + 'px';
			if( pageName == 'company' )
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext2.png)';
			}
			else
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext2.png)';
			}
			document.getElementById( comp_linename ).style.height = 348 + 'px';
			document.getElementById( comp_textname ).style.paddingTop = 337 + 'px';
			document.getElementById( comp_linename ).style.marginTop = -300 + 'px';
		}
		else if( expanded == 4 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext4.png)';
			document.getElementById( 'adv_blue_line' ).style.height = 196 + 'px';
			document.getElementById( 'adv_blue' ).style.paddingTop = 186 + 'px';
			document.getElementById( 'adv_blue_line' ).style.marginTop = -131 + 'px';
			if( pageName == 'applications' )
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext4.png)';
			}
			else
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext4.png)';
			}
			document.getElementById( app_linename ).style.height = 307 + 'px';
			document.getElementById( app_textname ).style.paddingTop = 297 + 'px';
			document.getElementById( app_linename ).style.marginTop = -80 + 'px';
			if( pageName == 'financial' )
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext4.png)';
			}
			else
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext4.png)';
			}
			document.getElementById( fin_linename ).style.height = 350 + 'px';
			document.getElementById( fin_textname ).style.paddingTop = 340 + 'px';
			document.getElementById( fin_linename ).style.marginTop = -302 + 'px';
			if( pageName == 'company' )
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext4.png)';
			}
			else
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext4.png)';
			}
			document.getElementById( comp_linename ).style.height = 393 + 'px';
			document.getElementById( comp_textname ).style.paddingTop = 382 + 'px';
			document.getElementById( comp_linename ).style.marginTop = -345 + 'px';
		}
	}
	else if( num == 221 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_green_line.png)';
		document.getElementById( 'thermo101_blue_line' ).style.backgroundImage = 'url(images/thermo101_green_line.png)';
	}
	else if( num == 222 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_green_line.png)';
		document.getElementById( 'caes_blue_line' ).style.backgroundImage = 'url(images/caes_green_line.png)';
	}
	else if( num == 223 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_green_line.png)';
		document.getElementById( 'iso_blue_line' ).style.backgroundImage = 'url(images/iso_green_line.png)';
	}
	else if( num == 224 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_green_line.png)';
		document.getElementById( 'cogen_blue_line' ).style.backgroundImage = 'url(images/cogen_green_line.png)';
	}
	else if( num == 23 )
	{
		if( expanded == 1 )
		{
			expanded = 3;
			document.getElementById( 'box1' ).style.height = 165 + 'px';
			document.getElementById( 'box1' ).style.width = 140 + 'px';
			document.getElementById( 'tech_blue' ).style.marginTop = -159 + 'px';
		}
		else if( expanded == 2 )
		{
			expanded = 4;
			document.getElementById( 'box1' ).style.height = 230 + 'px';
			document.getElementById( 'box1' ).style.width = 140 + 'px';
			document.getElementById( 'tech_blue' ).style.marginTop = -224 + 'px';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'conv_blue' ).style.visibility = 'visible';
		document.getElementById( 'conv_blue_line' ).style.visibility = 'visible';
		document.getElementById( 'heat_blue' ).style.visibility = 'visible';
		document.getElementById( 'heat_blue_line' ).style.visibility = 'visible';
		if( expanded == 3 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext1.png)';
			document.getElementById( 'adv_blue_line' ).style.height = 131 + 'px';
			document.getElementById( 'adv_blue' ).style.paddingTop = 123 + 'px';
			document.getElementById( 'adv_blue_line' ).style.marginTop = -66 + 'px';
			if( pageName == 'applications' )
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext2.png)';
			}
			else
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext2.png)';
			}
			document.getElementById( app_linename ).style.height = 262 + 'px';
			document.getElementById( app_textname ).style.paddingTop = 252 + 'px';
			document.getElementById( app_linename ).style.marginTop = -80 + 'px';
			if( pageName == 'financial' )
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext2.png)';
			}
			else
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext2.png)';
			}
			document.getElementById( fin_linename ).style.height = 305 + 'px';
			document.getElementById( fin_textname ).style.paddingTop = 295 + 'px';
			document.getElementById( fin_linename ).style.marginTop = -257 + 'px';
			if( pageName == 'company' )
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext2.png)';
			}
			else
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext2.png)';
			}
			document.getElementById( comp_linename ).style.height = 348 + 'px';
			document.getElementById( comp_textname ).style.paddingTop = 337 + 'px';
			document.getElementById( comp_linename ).style.marginTop = -300 + 'px';
		}
		else if( expanded == 4 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext4.png)';
			document.getElementById( 'adv_blue_line' ).style.height = 196 + 'px';
			document.getElementById( 'adv_blue' ).style.paddingTop = 186 + 'px';
			document.getElementById( 'adv_blue_line' ).style.marginTop = -131 + 'px';
			if( pageName == 'applications' )
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext4.png)';
			}
			else
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext4.png)';
			}
			document.getElementById( app_linename ).style.height = 307 + 'px';
			document.getElementById( app_textname ).style.paddingTop = 297 + 'px';
			document.getElementById( app_linename ).style.marginTop = -80 + 'px';
			if( pageName == 'financial' )
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext4.png)';
			}
			else
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext4.png)';
			}
			document.getElementById( fin_linename ).style.height = 350 + 'px';
			document.getElementById( fin_textname ).style.paddingTop = 340 + 'px';
			document.getElementById( fin_linename ).style.marginTop = -302 + 'px';
			if( pageName == 'company' )
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext4.png)';
			}
			else
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext4.png)';
			}
			document.getElementById( comp_linename ).style.height = 393 + 'px';
			document.getElementById( comp_textname ).style.paddingTop = 382 + 'px';
			document.getElementById( comp_linename ).style.marginTop = -345 + 'px';
		}
		if( expanded == 2  || expanded == 4 )
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_green_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_green_line.png)';
		}
	}
	else if( num == 231 )
	{
		if( expanded == 2  || expanded == 4 )
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_green_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_green_line.png)';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'conv_blue_line' ).style.backgroundImage = 'url(images/conv_green_line.png)';
	}
	else if( num == 232 )
	{
		if( expanded == 2 || expanded == 4 )
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_green_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_green_line.png)';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
		document.getElementById( 'heat_blue_line' ).style.backgroundImage = 'url(images/heat_green_line.png)';
	}
	else if( num == 24 )
	{
		if( expanded == 4 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_green_line_ext4.png)';
		}
		else if( expanded == 3 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_green_line_ext1.png)';
		}
		else if( expanded == 2 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_green_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_green_line.png)';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_green_line.png)';
	}
	else if( num == 3 )
	{
		if( expanded == 4 )
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext4.png)';
		}
		else if( expanded == 2 || expanded == 3 )
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext2.png)';
		}
		else if( expanded == 1 )
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line_ext1.png)';
		}
		else
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line.png)';
		}
	}
	else if( num == 4 )
	{
		if( expanded == 4 )
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext4.png)';
		}
		else if( expanded == 2 || expanded == 3 )
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext2.png)';
		}
		else if( expanded == 1 )
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line_ext1.png)';
		}
		else
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line.png)';
		}
	}
	else if( num == 5 )
	{
		if( expanded == 4 )
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext4.png)';
		}
		else if( expanded == 2 || expanded == 3 )
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext2.png)';
		}
		else if( expanded == 1 )
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line_ext1.png)';
		}
		else
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line.png)';
		}
	}
	else if( num == 6 )
	{
		if( content_counter > 0 )
		{
			document.getElementById('prev_button_img').src = 'images/prev_green.png';
		}
	}
	else if( num == 7 )
	{
		if( end == false )
		{
			document.getElementById('next_button_img').src = 'images/next_green.png';
		}
	}
}

function toBlue( num, e, pageName )
{
	if( num == 1 )
	{
		document.getElementById( 'home_blue_line' ).style.backgroundImage = 'url(images/home_blue_line.png)';
	}
	else if( num == 2 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
		var tg = e.toElement;
		if( navigator.appName=="Netscape")
		{
			tg = e.relatedTarget;
		}
		if( tg.nodeName != 'A' )
		{
			document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
			document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_blue_line.png)';
			document.getElementById( 'over_blue' ).style.visibility = 'hidden';
			document.getElementById( 'over_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'thermo_blue' ).style.visibility = 'hidden';
			document.getElementById( 'thermo_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'our_blue' ).style.visibility = 'hidden';
			document.getElementById( 'our_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'adv_blue' ).style.visibility = 'hidden';
			document.getElementById( 'adv_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'thermo101_blue' ).style.visibility = 'hidden';
			document.getElementById( 'thermo101_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'caes_blue' ).style.visibility = 'hidden';
			document.getElementById( 'caes_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'iso_blue' ).style.visibility = 'hidden';
			document.getElementById( 'iso_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'cogen_blue' ).style.visibility = 'hidden';
			document.getElementById( 'cogen_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'conv_blue' ).style.visibility = 'hidden';
			document.getElementById( 'conv_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'heat_blue' ).style.visibility = 'hidden';
			document.getElementById( 'heat_blue_line' ).style.visibility = 'hidden';
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line.png)';
			document.getElementById( 'adv_blue_line' ).style.height = 86 + 'px';
			document.getElementById( 'adv_blue' ).style.paddingTop = 77 + 'px';
			document.getElementById( 'adv_blue_line' ).style.marginTop = -66 + 'px';
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line.png)';
			document.getElementById( 'our_blue_line' ).style.height = 66 + 'px';
			document.getElementById( 'our_blue' ).style.paddingTop = 57 + 'px';
			document.getElementById( 'our_blue_line' ).style.marginTop = -46 + 'px';
			if( pageName == 'applications' )
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_green_line.png)';
			}
			else
			{
				document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line.png)';
			}
			document.getElementById( app_linename ).style.height = 130 + 'px';
			document.getElementById( app_textname ).style.paddingTop = 121 + 'px';
			if( pageName == 'financial' )
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_green_line.png)';
			}
			else
			{
				document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line.png)';
			}
			document.getElementById( fin_linename ).style.height = 175 + 'px';
			document.getElementById( fin_textname ).style.paddingTop = 165 + 'px';
			document.getElementById( fin_linename ).style.marginTop = -125 + 'px';
			if( pageName == 'company' )
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_green_line.png)';
			}
			else
			{
				document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line.png)';
			}
			document.getElementById( comp_linename ).style.height = 220 + 'px';
			document.getElementById( comp_textname ).style.paddingTop = 210 + 'px';
			document.getElementById( comp_linename ).style.marginTop = -170 + 'px';
			document.getElementById( 'box1' ).style.height = 120 + 'px';
			document.getElementById( 'box1' ).style.width = 140 + 'px';
			document.getElementById( 'tech_blue' ).style.marginTop = -114 + 'px';
			expanded = 0;
		}
	}
	else if( num == 21 )
	{
		document.getElementById( 'over_blue_line' ).style.backgroundImage = 'url(images/over_blue_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 22 )
	{
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_blue_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 221 )
	{
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_blue_line.png)';
		document.getElementById( 'thermo101_blue_line' ).style.backgroundImage = 'url(images/thermo101_blue_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 222 )
	{
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_blue_line.png)';
		document.getElementById( 'caes_blue_line' ).style.backgroundImage = 'url(images/caes_blue_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 223 )
	{
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_blue_line.png)';
		document.getElementById( 'iso_blue_line' ).style.backgroundImage = 'url(images/iso_blue_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 224 )
	{
		document.getElementById( 'thermo_blue_line' ).style.backgroundImage = 'url(images/thermo_blue_line.png)';
		document.getElementById( 'cogen_blue_line' ).style.backgroundImage = 'url(images/cogen_blue_line.png)';
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 23 )
	{
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
		if( expanded == 2 || expanded == 4 )
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line.png)';
		}
	}
	else if( num == 231 )
	{
		if( expanded == 2 || expanded == 4  )
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line.png)';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
		document.getElementById( 'conv_blue_line' ).style.backgroundImage = 'url(images/conv_blue_line.png)';
	}
	else if( num == 232 )
	{
		if( expanded == 2  || expanded == 4 )
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'our_blue_line' ).style.backgroundImage = 'url(images/our_blue_line.png)';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
		document.getElementById( 'heat_blue_line' ).style.backgroundImage = 'url(images/heat_blue_line.png)';
	}
	else if( num == 24 )
	{
		if( expanded == 4 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext4.png)';
		}
		else if( expanded == 3 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext1.png)';
		}
		else if( expanded == 2 )
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line_ext2.png)';
		}
		else
		{
			document.getElementById( 'adv_blue_line' ).style.backgroundImage = 'url(images/adv_blue_line.png)';
		}
		document.getElementById( 'tech_blue_line' ).style.backgroundImage = 'url(images/tech_blue_line.png)';
	}
	else if( num == 3 )
	{
		if( expanded == 4 )
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext4.png)';
		}
		else if( expanded == 2 || expanded == 3 )
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext2.png)';
		}
		else if( expanded == 1 )
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line_ext1.png)';
		}
		else
		{
			document.getElementById( app_linename ).style.backgroundImage = 'url(images/app_blue_line.png)';
		}
	}
	else if( num == 4 )
	{
		if( expanded == 4 )
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext4.png)';
		}
		else if( expanded == 2 || expanded == 3 )
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext2.png)';
		}
		else if( expanded == 1 )
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line_ext1.png)';
		}
		else
		{
			document.getElementById( fin_linename ).style.backgroundImage = 'url(images/fin_blue_line.png)';
		}
	}
	else if( num == 5 )
	{
		if( expanded == 4 )
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext4.png)';
		}
		else if( expanded == 2 || expanded == 3 )
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext2.png)';
		}
		else if( expanded == 1 )
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line_ext1.png)';
		}
		else
		{
			document.getElementById( comp_linename ).style.backgroundImage = 'url(images/comp_blue_line.png)';
		}
	}
	else if( num == 6 )
	{
		if( content_counter > 0 )
		{
			document.getElementById('prev_button_img').src = 'images/prev_blue.png';
		}
	}
	else if( num == 7 )
	{
		if( end == false )
		{
			document.getElementById('next_button_img').src = 'images/next_blue.png';
		}
	}
}

function loadNum( pageName )
{
	var tmpText;
	if( pageName == "thermo101" )
	{
		if( content_counter === 0 )
		{
			tmpText = "<div id=\"blue_img_classicalcaes\"></div><div style=\"height:28px;\"></div><div id=\"blue_header\">THERMODYNAMICS 101</div><div id=\"blue_text\">One of the core innovations of the SustainX technology is the use of isothermal, as opposed to adiabatic, gas cycling. An adiabatic process is one that does not exchange heat with its surrounding environment. Without heat transfer, a gas will increase in temperature as it is compressed; and as it gets hotter, it tends to resist further compression (i.e., each increment of compression must be performed on a volume of gas that is at higher pressure than if it had not been heated by prior compression). While undergoing adiabatic expansion (such as is used in classical CAES) the gas cools, resulting in a second inefficiency; at each increment of expansion, the gas is at lower pressure than if it had not been cooled by prior expansion, and so can do less useful work.</div></div>";
			document.getElementById('prev_button_img').src = 'images/prev_gray.png';
		}
		else if( content_counter == 1 )
		{
			tmpText = "<span id=\"blue_header\">PRESSURE </span><span id=\"white_header\">VS.</span><span id=\"blue_header\"> VOLUME CURVE</span><div style=\"background:url('images/thermo101_graph1.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:317px;width:218px;margin-top:-345px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"90\" width=\"218\"/><div id=\"white_text\" style=\"margin-top:-90px;\"><p>For a given amount (mass) of gas, the isothermal (constant temperature) relationship between the gas volume and pressure is as shown for gas at ambient temperature.</p></div></div></div>";
			if( forw == true )
			{
				document.getElementById('prev_button_img').src = 'images/prev_blue.png';
			}
		}
		else if( content_counter == 2 )
		{
			tmpText = "<span id=\"blue_header\">PRESSURE </span><span id=\"white_header\">VS.</span><span id=\"blue_header\"> VOLUME CURVE</span><span id=\"white_header\"> higher temp</span><div style=\"background:url('images/thermo101_graph2.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:317px;width:218px;margin-top:-331px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"66\" width=\"218\"/><div id=\"white_text\" style=\"margin-top:-66px;\"><p>For the same mass of air, the isothermal curve is higher if the gas is at higher temperature…</p></div></div></div>";
		}
		else if( content_counter == 3 )
		{
			tmpText = "<span id=\"blue_header\">PRESSURE </span><span id=\"white_header\">VS.</span><span id=\"blue_header\"> VOLUME CURVE</span><span id=\"white_header\"> lower temp</span><div style=\"background:url('images/thermo101_graph3.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:317px;width:218px;margin-top:-331px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"66\" width=\"218\"/><div id=\"white_text\" style=\"margin-top:-66px;\"><p>...and the isothermal curve for the same mass of gas is lower if the gas temperature is lower.</p></div></div></div>";
		}
		else if( content_counter == 4 )
		{
			tmpText = "<span id=\"blue_header\">WORK DURING </span><span id=\"white_header\">COMPRESSION</span><div style=\"background:url('images/thermo101_graph4.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-345px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"143\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-143px;\"><p>For a given compression (e.g. from point A to point B), the work (a.k.a. energy) used to compress the gas is equal to the area under the PV curve (shaded area).</p><p>This particular compression is a perfectly isothermal compression because the pressure and volume of the gas as it is compressed tracks the isothermal curve.</p></div></div></div>";
		}
		else if( content_counter == 5 )
		{
			tmpText = "<span id=\"blue_header\">WORK DURING </span><span id=\"white_header\">EXPANSION</span><div style=\"background:url('images/thermo101_graph5.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-345px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"80\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-80px;\"><p>Similarly, for a given expansion (e.g. from point B to point A), the work done by the gas (a.k.a. energy released) is also equal to the area under the PV curve (shaded area).</p></div></div></div>";
		}
		else if( content_counter == 6 )
		{
			tmpText = "<span id=\"blue_header\">PERFECT ISOTHERMAL </span><span id=\"white_header\">EFFICIENCY</span><div style=\"background:url('images/thermo101_graph6.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:280px;width:255px;margin-top:-355px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"206\" width=\"255\"/><div id=\"white_text\" style=\"margin-top:-206px;\"><p>Therefore, if both the compression and expansion are perfectly isothermal, the energy used to compress the gas is equal to the energy released during expansion, and the thermal efficiency is 100%.</p><p>However, no gas compression or expansion can be perfectly isothermal.</p><p>This is because isothermal gas compression and expansion requires heat transfer to occur. However, for heat transfer to occur, some temperature differential (&#916;T) with the surroundings must exist.</p></div></div></div>";
		}
		else if( content_counter == 7 )
		{
			tmpText = "<span id=\"blue_header\">ACTUAL GAS </span><span id=\"white_header\">COMPRESSION</span><div style=\"background:url('images/thermo101_graph7.png');width:515px;height:333px;margin-top:47px\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-390px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"169\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-169px;\"><p>An actual compression will fall somewhere between the isothermal case (requiring perfect heat transfer) and the adiabatic case (no heat transfer).</p><p>It is worth noting that point C is not only higher in pressure than point B, but it is also higher in temperature as it lies up and to the right of point B. This is due to the tendency of gas to heat up as it is compressed if heat transfer is not allowed to occur.</p></div></div></div>";
		}
		else if( content_counter == 8 )
		{
			tmpText = "<span id=\"blue_header\">ACTUAL GAS </span><span id=\"white_header\">EXPANSION</span><div style=\"background:url('images/thermo101_graph8.png');width:515px;height:333px;margin-top:47px;\"></div<div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-390px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"195\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-195px;\"><p>An actual expansion will also fall somewhere between the isothermal case (requiring perfect heat transfer) and the adiabatic case (no heat transfer).</p><p>It is worth noting that point D is not only lower in pressure than point B, but it is also lower in temperature as it lies down and to the left of the isothermal curve on which B lies (the ambient temperature curve). This is due to the tendency of gas to cool down as it is expanded if heat transfer is not allowed to occur.</p></div></div></div>";
		}
		else if( content_counter == 9 )
		{
			tmpText = "<span id=\"blue_header\">ADIABATIC CYCLE \\ </span><span id=\"white_header\">COMPRESSION</span><div style=\"background:url('images/thermo101_graph9.png');width:515px;height:333px;margin-left:-1px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-345px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"155\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-155px;\"><p>In an adiabatic compression, gas is compressed from point A to point C, which causes the gas to heat up to very high temperatures.</p><p>(Note: for high-pressure air storage, no current compressors can compress the air directly from point A to point C due to the very high temperature of point C and the resulting thermal stresses).</p></div></div></div>";
		}
		else if( content_counter == 10 )
		{
			tmpText = "<span id=\"blue_header\">ADIABATIC CYCLE \\ </span><span id=\"white_header\">HEAT LOSSES</span><div style=\"background:url('images/thermo101_graph10.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-304px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"66\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-66px;\"><p>During storage of the gas, the gas will lose heat energy to the surroundings and cool down to ambient temperature (point B).</p></div></div></div>";
			if( forw == false )
			{
				document.getElementById('next_button_img').src = 'images/next_blue.png';
			}
			end = false;
		}
		else if( content_counter == 11 )
		{
			tmpText = "<span id=\"blue_header\">ADIABATIC CYCLE \\ </span><span id=\"white_header\">EXPANSION</span><div style=\"background:url('images/thermo101_graph11.png');width:515px;height:333px;margin-top:47px;margin-left:-1px\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-367px;\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"180\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-180px;\"><p>In an adiabatic expansion of gas stored at ambient temperature, gas is expanded from point B to point D, which causes the gas to decrease in temperature.</p><p>This is the type of expansion that occurs in a gas turbine.</p><p>Because no heat transfer occurs during adiabatic expansion, the heat energy dissipated to the surroundings during compression is not recovered.</p></div></div></div>";
			document.getElementById('next_button_img').src = 'images/next_gray.png';
			end = true;
		}
	}
	else if( pageName == "classicalcaes" )
	{
		if( content_counter === 0 )
		{
			tmpText = "<div id=\"blue_img_classicalcaes\"></div><div style=\"height:28px;\"></div><div id=\"blue_header\">CLASSICAL CAES</div><div id=\"blue_text\">There are currently only two CAES facilities in operation worldwide.  The first is a 270 MW unit that was constructed in Huntdorf, Germany in 1978 and the other, a 110 MW unit, was constructed in McIntosh, Alabama in 1991. Classical CAES facilities purchase inexpensive off-peak power and use it to adiabatically compress air into underground salt or limestone caverns.  During peak-time, compressed air is drawn from the cavern to replace the compression phase in natural-gas-fired combustion turbines.  The result is reduced operating costs for the gas turbine, as the compression phase typically consumes approximately one-half of the electricity generated.<p>Existing CAES systems suffer from poor thermal efficiency (due to adiabatic cycling), mandatory pairing with natural-gas-fired generation, are inherently large scale (with corresponding capital intensity) and are geographically constrained (i.e., limestone caverns are required).</div></div>";
			document.getElementById('prev_button_img').src = 'images/prev_gray.png';
		}
		else if( content_counter == 1 )
		{
			tmpText = "<div id=\"blue_img_classicalcaes\"></div><div style=\"height:28px;\"></div><div id=\"blue_header\">CLASSICAL CAES</div><div id=\"blue_text\">Although ideal adiabatic and isothermal cycles would have identical (100%) round-trip efficiencies—ideal adiabatic compression is isentropic and reversible—the real-world advantages of isothermal cycling (as supported by SustainX’s technological innovations) are decisive.  Prevention of significant heat loss during compression and storage would be complex and expensive: for classical CAES utilizing underground caverns, insulating the storage chamber is essentially impossible.  Moreover, in an efficient adiabatic system, all mechanical components would have to be able to handle higher pressures and temperatures than for an equivalent isothermal system, adding cost at every turn.</div></div>";
			if( forw == true )
			{
				document.getElementById('prev_button_img').src = 'images/prev_blue.png';
			}
		}
		else if( content_counter == 2 )
		{
			tmpText = "<span id=\"blue_header\">ALABAMA CAES \\ </span><span id=\"white_header\">DIABATIC COMPRESSION CYCLE</span><div style=\"background:url('images/classicalcaes_graph1.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:295px;width:240px;margin-top:-359px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"195\" width=\"240\"/><div id=\"white_text\" style=\"margin-top:-195px;\"><p>In practice, no compressed air energy storage (CAES) facility uses pure adiabatic compression or expansion due to the energy losses and temperatures involved.</p><p>The McIntosh Alabama CAES plant, for example, uses four turbo-compressors with intercoolers (heat exchangers) to reduce maximum gas temperatures, thereby moving the compression line  below the pure adiabatic case and closer to the purely isothermal case, increasing thermal efficiency.</p></div></div></div>";
		}
		else if( content_counter == 3 )
		{
			tmpText = "<span id=\"blue_header\">ALABAMA CAES \\ </span><span id=\"white_header\">AFTERCOOLER &amp; GAS STORAGE</span><div style=\"background:url('images/classicalcaes_graph2.png');width:515px;height:333px;margin-top:46px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:266px;width:269px;margin-top:-346px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"180\" width=\"269\"/><div id=\"white_text\" style=\"margin-top:-180px;\"><p>However, a good deal of heat energy is still lost in the compression process (shaded area).</p><p>While additional turbocompressors and intercoolers do make the process more thermally efficiency by allowing it to be closer to the isothermal case, there are drawbacks. The additional turbocompressors means additional mechanical and volumetric efficiency losses. The additional intercoolers result in greater pressure-drop losses. Furthermore, the added components result in a significant additional capital cost. </p></div></div></div>";
		}
		else if( content_counter == 4 )
		{
			tmpText = "<span id=\"blue_header\">ALABAMA CAES \\ </span><span id=\"white_header\">RECUPERATOR PREHEATER</span><div style=\"background:url('images/classicalcaes_graph3.png');width:515px;height:333px;margin-top:47px;margin-left:-1px\"></div><div id=\"graph_whitebox\" style=\"margin-left:194px;width:341px;margin-top:-347px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"106\" width=\"341\"/><div id=\"white_text\" style=\"margin-top:-106px;\"><p>In the Alabama plant, natural gas combustion is used to heat the expanding gas to prevent the gas from cooling down to very cold temperatures. The first stage of the expansion process uses waste heat from the combustion in gas at the end of the cycle (line IA) to preheat the at the gas at the beginning of the cycle (line BE).</p></div></div></div>";
			if( forw == false )
			{
				document.getElementById('next_button_img').src = 'images/next_blue.png';
			}
			end = false;
		}
		else if( content_counter == 5 )
		{
			tmpText = "<span id=\"blue_header\">ALABAMA CAES \\ </span><span id=\"white_header\">RECUPERATOR PREHEATER</span><div style=\"background:url('images/classicalcaes_graph4.png');width:515px;height:333px;margin-top:47px;margin-left:-1px\"></div><div id=\"graph_whitebox\" style=\"margin-left:253px;width:282px;margin-top:-347px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"81\" width=\"282\"/><div id=\"white_text\" style=\"margin-top:-81px;\"><p>Adiabatic expansion occurs following combustion of the compressed air with natural gas, which provides the heat needed to keep the gasses above ambient temperature.</p></div></div></div>";
			document.getElementById('next_button_img').src = 'images/next_gray.png';
			end = true;
		}
	}
	else if( pageName == "isothermalcaes" )
	{
		if( content_counter === 0 )
		{
			tmpText = "<div id=\"blue_img_isothermalcaes\"></div><div style=\"height:28px;\"></div><div id=\"blue_header\">ISOTHERMAL CAES</div><div id=\"blue_text\">Isothermal gas compression and expansion cycles, such as those employed by SustainX can achieve very high thermal efficiencies.  Isothermal gas compression and expansion occurs when the rate of volume change is slow relative to the rate of heat transfer to or from the system, allowing for significant heat transfer to occur.<p>As gas is compressed, it tends to increase in temperature. During a sufficiently slow (i.e., isothermal) compression, this increase in temperature is countered by heat flow from the gas to the surroundings, allowing the gas to remain at roughly constant temperature. Similarly, as gas expands, it tends to cool down. During a sufficiently slow expansion, this decrease in temperature is countered by heat flow from the surroundings back into the gas, again allowing the gas to remain at roughly constant temperature. If the gas remains at the same temperature during both compression and expansion, then the heat recovered from the surroundings during expansion is equal to the heat originally emitted to the surroundings during compression.</p></div></div>";
			document.getElementById('prev_button_img').src = 'images/prev_gray.png';
		}
		else if( content_counter == 1 )
		{
			tmpText = "<div id=\"blue_img_isothermalcaes\"></div><div style=\"height:28px;\"></div><div id=\"blue_header\">ISOTHERMAL CAES</div><div id=\"blue_text\">Near-isothermal gas compression and expansion can be achieved in practice, as done by SustainX, by paying careful attention to rates of compression, expansion and heat transfer. A near-isothermal gas cycle yields very high (>90%) thermal efficiencies and thus more total energy output than adiabatic expansion of an equal quantity of gas at the same initial temperature and pressure.  The SustainX system is designed specifically to expedite heat transfer to and from the gas, allowing for increased power output while maintaining high thermal efficiencies.</div></div>";
			if( forw == true )
			{
				document.getElementById('prev_button_img').src = 'images/prev_blue.png';
			}
		}
		else if( content_counter == 2 )
		{
			tmpText = "<span id=\"blue_header\">SUSTAINX ESS \\ </span><span id=\"white_header\"> COMPRESSION CYCLE</span><div style=\"background:url('images/isocaes_graph1.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:228px;width:307px;margin-top:-359px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"172\" width=\"307\"/><div id=\"white_text\" style=\"margin-top:-172px;\"><p>The SustainX hydraulic-pneumatic conversion system uses a completely different approach to compressed air energy storage. Rather than compressing and expanding the air in turbocompressors and turbines, in which the process is inherently adiabatic, the SustainX system instead compresses and expands the gas within hydraulic cylinders (accumulators and intensifiers), which allows for controlled heat transfer with the ambient surroundings during compression and expansion.  The result is a near-isothermal compression process (red line) in which the gas temperature is only slightly above ambient.</p></div></div></div>";
		}
		else if( content_counter == 3 )
		{
			tmpText = "<span id=\"blue_header\">SUSTAINX ESS \\ </span><span id=\"white_header\"> EXPANSION CYCLE</span><div style=\"background:url('images/isocaes_graph2.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:228px;width:307px;margin-top:-339px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"120\" width=\"307\"/><div id=\"white_text\" style=\"margin-top:-120px;\"><p>Similarly to compression the result of the SustainX design is a near-isothermal expansion process (blue line) in which the gas temperature is only slightly below ambient. The controlled rate of gas expansion allows time for heat energy to be recovered from the surroundings, maintaining the gas temperature at only slightly below ambient. The result is very high thermal efficiencies.</p></div></div></div>";
			if( forw == false )
			{
				document.getElementById('next_button_img').src = 'images/next_blue.png';
			}
			end = false;
		}
		else if( content_counter == 4 )
		{
			tmpText = "<span id=\"blue_header\">SUSTAINX ESS \\ </span><span id=\"white_header\"> THERMAL EFFICIENCY</span><div style=\"background:url('images/isocaes_graph3.png');width:515px;height:333px;margin-top:47px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:228px;width:307px;margin-top:-329px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"90\" width=\"307\"/><div id=\"white_text\" style=\"margin-top:-90px;\"><p>The area between the compression curve (orange) and the expansion curve (light green) represents the total heat energy lost during the cycle (shaded area). SustainX has demonstrated thermal efficiencies greater than 90% for both compression and expansion.</p></div></div></div>";
			document.getElementById('next_button_img').src = 'images/next_gray.png';
			end = true;
		}
	}
	else if( pageName == "cogen" )
	{
		if( content_counter === 0 )
		{
			tmpText = "<div id=\"blue_img_isothermalcaes\"></div><div style=\"height:28px;\"></div><div id=\"blue_header\">COGENERATION</div><div id=\"blue_text\"><strong>Isothermal cycling utilizes the environment as both a sink and source of thermal energy.</strong> The use of heat exchange also allows an isothermal system to exploit thermal gradients in its vicinity. For example, diurnal temperature variations (compressing at night when the air is cooler and expanding during the day when it is warmer) can increase the efficiency of the cycle by 5% simply by taking advantage of free thermal energy in the surrounding environment. Furthermore, low-grade waste heat from any industrial process can be used to continually heat the gas during expansion to substantially boost the effective efficiency. Using the SustainX ESS in this <strong>cogeneration mode</strong> is quite attractive wherever heat sources are present.</div></div>";
			document.getElementById('prev_button_img').src = 'images/prev_gray.png';
		}
		else if( content_counter == 1 )
		{
			tmpText = "<span id=\"blue_header\">SUSTAINX ESS \\ </span><span id=\"white_header\"> EFFECT OF AMBIENT TEMPERATURE SWING</span><div style=\"background:url('images/cogen_graph1.png');width:515px;height:333px;margin-top:72px;\"></div><div id=\"graph_whitebox\" style=\"margin-left:158px;width:377px;margin-top:-384px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"142\" width=\"377\"/><div id=\"white_text\" style=\"margin-top:-142px;\"><p>A change in the ambient pressure can have an effect on the pressure of the stored gas.</p><p>If the ambient temperature decreases after the gas is compressed, then the pressure in the gas bottle will decrease (light green arrow) from B to B’. This would be the case at night, for example, if the gas was originally compressed during a hot day. If the gas is then expanded (yellow curve), less energy will be recovered from the surroundings and the thermal efficiency will be lower.</p></div><div id=\"graph_whitebox_text2\" style=\"margin-left:50px;\"><img src=\"images/trans_green.png\" alt=\"\" height=\"60\" width=\"327\"/><div id=\"white_text\" style=\"margin-top:-64px\"><p>As a point of reference, a 30&deg; decrease in ambient temperature between the time of compression and the time of expansion will result in a 6% decrease in thermal efficiency</p></div></div></div>";
			if( forw == true )
			{
				document.getElementById('prev_button_img').src = 'images/prev_blue.png';
			}
		}
		else if( content_counter == 2 )
		{
			tmpText = "<span id=\"blue_header\">SUSTAINX ESS \\ </span><span id=\"white_header\"> EFFECT OF AMBIENT TEMPERATURE SWING</span><div style=\"background:url('images/cogen_graph2.png');width:515px;height:333px;margin-top:72px\"></div><div id=\"graph_whitebox\" style=\"margin-left:98px;width:437px;margin-top:-384px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"116\" width=\"437\"/><div id=\"white_text\" style=\"margin-top:-116px;\"><p>On the other hand, if the ambient temperature increases after the gas is compressed, then the pressure in the gas in the storage tank will increase (orange arrow) from B to B’. This would be the case during the daytime, for example, if the gas was originally compressed during a cold night, a typical situation for energy arbitrage, buying cheap energy at night, storing it, and returning it during the daytime. If the gas is then expanded (orange curve), more energy will be recovered from the surroundings and the thermal efficiency will be higher.</p></div><div id=\"graph_whitebox_text2\" style=\"margin-left:155px;\"><img src=\"images/trans_green.png\" alt=\"\" height=\"122\" width=\"282\"/><div id=\"white_text\" style=\"margin-top:-126px\"><p>As a point of reference, a 30&deg; increase in ambient temperature between the time of compression and the time of expansion will result in a 6% increase in thermal efficiency.</p><p>This has the potential to result in a greater than 100% thermal efficiency for the expansion due to the heat added by the increase in ambient temperature.</p></div></div></div>";
			if( forw == false )
			{
				document.getElementById('next_button_img').src = 'images/next_blue.png';
			}
			end = false;
		}
		else if( content_counter == 3 )
		{
			tmpText = "<span id=\"blue_header\">SUSTAINX ESS \\ </span><span id=\"white_header\"> COGENERATION POTENTIAL</span><div style=\"background:url('images/cogen_graph3.png');width:515px;height:333px;margin-top:72px;margin-left:-1px\"></div><div id=\"graph_whitebox\" style=\"margin-left:128px;width:407px;margin-top:-384px\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"86\" width=\"407\"/><div id=\"white_text\" style=\"margin-top:-90px;\"><p>An even greater efficiency gain can be realized by pairing the SustainX ESS with a process that generates waste heat. One example situation would be pairing the system with a nuclear power plant, storing energy off-peak. When the stored gas is expanded, waste heat from the nuclear cooling tower can be used to pre-heat the gas to higher temperature, moving it from B to D’.</p></div><div id=\"graph_whitebox_text2\" style=\"margin-left:115px;\"><img src=\"images/trans_green.png\" alt=\"\" height=\"82\" width=\"292\"/><div id=\"white_text\" style=\"margin-top:-86px\"><p>For example, if a power plant produces 100&deg;C waste steam, the heat provided by condensing the waste steam will allow the SustainX ESS to expand the stored air isothermally at 100&deg;C rather than the ambient 25&deg;C. The result is a 25% increase in output energy.</p></div></div></div>";
			document.getElementById('next_button_img').src = 'images/next_gray.png';
			end = true;
		}
	}
	else if( pageName == "staged" )
	{
		if( content_counter === 0 )
		{
			tmpText = "<div id=\"blue_header\">BEYOND THERMODYNAMICS</div><div id=\"white_header\">Maximizing the Hydraulic Component Efficiency</div><div style=\"margin-left:-42px; margin-top:37px;\"><img alt=\"\" src=\"images/our_graphic1.png\" /></div><div id=\"graph_whitebox\" style=\"width:535px;margin-top:20px;\"><div id=\"graph_whitebox_text\"><img src=\"images/trans_white.png\" alt=\"\" height=\"106\" width=\"535\"/><div id=\"white_text\" style=\"margin-top:-106px;\"><p>The technology being pioneered by SustainX uses an efficient hydraulic drivetrain to convert electrical energy into potential energy stored as compressed air. The use of hydraulics, among other advantages, allows us to precisely control gas expansion and compression, thus maximizing thermal efficiency, allowing for high-efficiency conversion of mechanical to electrical energy.  The system works similarly in reverse to convert the potential energy stored in the compressed air back into electrical energy. No fuel input is involved.</p></div></div></div>";
			document.getElementById('prev_button_img').src = 'images/prev_gray.png';
			document.getElementById('next_button_img').src = 'images/next_blue.png';
			end = false;
		}
		else if( content_counter == 1 )
		{
			tmpText = "";
			document.getElementById('next_button_img').src = 'images/next_gray.png';
			document.getElementById('prev_button_img').src = 'images/prev_blue.png';
			end = true;
		}
	}
	document.getElementById( 'blue_mainsection' ).innerHTML = tmpText;
	document.getElementById( 'slide_num' ).innerHTML = ( content_counter + 1 ) + ' of ' + max_num;
}

function prevSection( pageName )
{
	forw = false;
	if( content_counter > 0 )
	{
		content_counter = content_counter - 1;
		loadNum( pageName );
	}
}

function nextSection( pageName )
{
	forw = true;
	if( pageName == "thermo101" )
	{
		max_num = 12;
	}
	else if( pageName == "classicalcaes" )
	{
		max_num = 6;
	}
	else if( pageName == "isothermalcaes" )
	{
		max_num = 5;
	}
	else if( pageName == "cogen" )
	{
		max_num = 4;
	}
	else if( pageName == "staged" )
	{
		max_num = 2;
	}
	if( content_counter < max_num - 1 )
	{
		content_counter = content_counter + 1;
		loadNum( pageName );
	}
}