//Script File for Gridlesshome.com
//03/23/2003
//v4

  if (document.images) {
  home_dn = new Image(101 ,35); 
  home_dn.src = "images/home_dn.jpg";
  home_dn = new Image(101 ,35); 
  home_dn.src = "images/home_bk.jpg";
  home_up = new Image(101 ,35); 
  home_up.src = "images/home_up.jpg";

  tour_dn = new Image(101 ,35); 
  tour_dn.src = "images/tour_dn.jpg";
  tour_dn = new Image(101 ,35); 
  tour_dn.src = "images/tour_bk.jpg";
  tour_up = new Image(101 ,35); 
  tour_up.src = "images/tour_up.jpg";

  info_dn = new Image(101 ,35);   
  info_dn.src = "images/info_dn.jpg";
  info_dn = new Image(101 ,35); 
  info_dn.src = "images/info_bk.jpg";
  info_up = new Image(101 ,35); 
  info_up.src = "images/info_up.jpg";

  links_dn = new Image(101 ,35); 
  links_dn.src = "images/links_dn.jpg";  
  links_dn = new Image(101 ,35); 
  links_dn.src = "images/links_bk.jpg";
  links_up = new Image(101 ,35); 
  links_up.src = "images/links_up.jpg";

  living_dn = new Image(101 ,35); 
  living_dn.src = "images/living_dn.jpg";
  living_dn = new Image(101 ,35); 
  living_dn.src = "images/living_bk.jpg";
  living_up = new Image(101 ,35); 
  living_up.src = "images/living_up.jpg";

  about_dn = new Image(101,35);
  about_dn.src = "images/about_dn.jpg";
  about_dn = new Image(101,35);
  about_dn.src = "images/about_bk.jpg";
  about_up = new Image(101,35);
  about_up.src = "images/about_up.jpg";
  }

function MM_findObj(n, d) 
{ //v4.01
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
	d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  if(!x && d.getElementById) x=d.getElementById(n); return x;
}

function MM_nbGroup(event, grpName) { //v6.0
var i,img,nbArr,args=MM_nbGroup.arguments;
  if (event == "init" && args.length > 2) {
    if ((img = MM_findObj(args[2])) != null && !img.MM_init) {
      img.MM_init = true; img.MM_up = args[3]; img.MM_dn = img.src;
      if ((nbArr = document[grpName]) == null) nbArr = document[grpName] = new Array();
      nbArr[nbArr.length] = img;
      for (i=4; i < args.length-1; i+=2) if ((img = MM_findObj(args[i])) != null) {
        if (!img.MM_up) img.MM_up = img.src;
        img.src = img.MM_dn = args[i+1];
        nbArr[nbArr.length] = img;
    } }
  } else if (event == "over") {
    document.MM_nbOver = nbArr = new Array();
    for (i=1; i < args.length-1; i+=3) if ((img = MM_findObj(args[i])) != null) {
      if (!img.MM_up) img.MM_up = img.src;
      img.src = (img.MM_dn && args[i+2]) ? args[i+2] : ((args[i+1])?args[i+1] : img.MM_up);
      nbArr[nbArr.length] = img;
    }
  } else if (event == "out" ) {
    for (i=0; i < document.MM_nbOver.length; i++) { img = document.MM_nbOver[i]; img.src = (img.MM_dn) ? img.MM_dn : img.MM_up; }
  } 
}


/*
The following script is based on a slideshow script written by
By Christian Carlessi Salvadó (cocolinks@c.net.gt). You can obtain the
original script at http://www.dynamicdrive.com.  I've made
modifications and corrections of the script to eliminate syntax errors
and make the script easier to read.  In addition, I've modified parts
of the script to make it function slightly differently from the original
script -- JB 11/22/2002
*/


g_fPlayMode = 0;
g_iimg = -1;
g_imax = 0;
g_ImageTable = new Array();

function ChangeImage(fFwd)
{
	if (fFwd)
	{
		if (++g_iimg==g_imax) g_iimg=0;
	}
	else
	{
		if (g_iimg==0) g_iimg=g_imax;
		g_iimg--;
	}
	Update();
}//endfn ChangeImage

function getobject(obj)
{
	if (document.getElementById)
	{
		return document.getElementById(obj);
	}
	else if (document.all)
	{
		return document.all[obj];
	}//endif
}//endfn getobject

function Update()
{
	getobject("_Ath_Slide").src = g_ImageTable[g_iimg][0];
	getobject("_Ath_FileName").innerHTML = g_ImageTable[g_iimg][1];
	getobject("_Ath_Img_X").innerHTML = g_iimg + 1;
	getobject("_Ath_Img_N").innerHTML = g_imax;
}//endfn Update

function Play()
{
	g_fPlayMode = !g_fPlayMode;
	if (g_fPlayMode)
	{
		getobject("btnPrev").disabled = getobject("btnNext").disabled = true;
		getobject("btnPlay").value = "  Stop  ";
		Next();
	}
	else 
	{
		getobject("btnPrev").disabled = getobject("btnNext").disabled = false;
		getobject("btnPlay").value = "  Play  ";
	}//endif
}//endfn Play

function OnImgLoad()
{
	if (g_fPlayMode) window.setTimeout("Tick()", g_dwTimeOutSec*1000);
}//endfn OnImgLoad

function Tick() 
{
	if (g_fPlayMode) Next();
}//endfn Tick

function Prev()
{
	ChangeImage(false);
}//endfn Prev

function Next()
{
	ChangeImage(true);
}//endfn Next

////configure below variables/////////////////////////////

//configure the below images and description to your own. 
g_ImageTable[g_imax++] = new Array ("images/hext4wh.jpg", "The front of the Simpson home.");
g_ImageTable[g_imax++] = new Array ("images/p01.jpg", "On the south eastern roof, solar water panels heat water for use in heating the home, as well as reducing the the dependency on the conventional water heater.")
g_ImageTable[g_imax++] = new Array ("images/p02.jpg", "Installation of the solar electric array required moving 16 racks of solar electric panels to the roof.  Each rack contains 4 solar panels.");
g_ImageTable[g_imax++] = new Array ("images/p05.jpg", "A wench and pulley system was used to make the task of installing the solar electric array easier.");
g_ImageTable[g_imax++] = new Array ("images/p07.jpg", "The fully assembled solar electric array provides 4 kilowatts of power and contains 64 solar electric panels.");
g_ImageTable[g_imax++] = new Array ("images/p03.jpg", "A view of the back of the house showing the solar electric array on the upper roof, the large, light and heat-gathering windows, and the calculated overhangs.");
g_ImageTable[g_imax++] = new Array ("images/p04.jpg", "Our energy efficient home is indistinguishable from any other home.");
g_ImageTable[g_imax++] = new Array ("images/p06.jpg", "This is a 150-gallon, hot-water tank that holds water heated with solar water panels, as well as a heat exchanger in the fireplace.  The water is used to preheat the furnace in the winter, and to reduce the need for the conventional water heater.");
g_ImageTable[g_imax++] = new Array ("images/p09.jpg", "The control panel for the solar hot water system. In the upper right corner is the mixing valve that mixes cold water with hot water from the tank, in order to keep the water going to the water heater at no more than 125&ordm;F");
g_ImageTable[g_imax++] = new Array ("images/p10.jpg", "There are three pumps for the solar hot water system.");
g_ImageTable[g_imax++] = new Array ("images/p11.jpg", "The solar electricity inverter and control system.  The system takes 48 volts of direct current (DC) and inverts it into 120 volts of alternating household current (AC).");
g_ImageTable[g_imax++] = new Array ("images/p12.jpg", "These batteries hold 8 Kilowatt hours (Kwh) of electricity for use at non-peak times.");
g_ImageTable[g_imax++] = new Array ("images/p13.jpg", "The house uses a conventional furnace that is supplemented by the solar hot water system to heat the house.");
g_ImageTable[g_imax++] = new Array ("images/p14.jpg", "Next to the standard 50 gallon water heater is the furnace plenum.  You can see the water lines carrying water into the plenum where it goes through a heat exchanger to help heat the house.  These lines carry water from the solar hot water system into the furnace and back to the 150 gallon hot water tank.");
g_ImageTable[g_imax++] = new Array ("images/p17.jpg", "On the first floor is the Hearth Room.  The room's windows allow sunlight to stream in during the winter, helping to heat the home.");
g_ImageTable[g_imax++] = new Array ("images/p18.jpg", "In the Living Room, the windows provide heat to the room in the winter, and light all year.");
g_ImageTable[g_imax++] = new Array ("images/p16.jpg", "The Kitchen is lit with energy efficient light bulbs and uses energy efficient appliances.");
g_ImageTable[g_imax++] = new Array ("images/p20.jpg", "Pictured here is a sample of the foam insulation that is used to insulate the attic.");
g_ImageTable[g_imax++] = new Array ("images/p35.jpg", "This is a view of the attic.  Notice the foam insulation covering the HVAC ductwork.");
g_ImageTable[g_imax++] = new Array ("images/p36.jpg", "Foam insulation is used throughout the attic.");
g_ImageTable[g_imax++] = new Array ("images/p37.jpg", "One of the four bathroom vents that are designed to allow air to vent outside, but not to allow air inside.");
g_ImageTable[g_imax++] = new Array ("images/p39.jpg", "Along the roof are attic vents, which allow air to escape.  The frequency of the vents improves ventilation in the summer, helping to keep the house cool and reduce the load on the air conditioner.  This helps lower electric costs in the summer.");
g_ImageTable[g_imax++] = new Array ("images/p26.jpg", "Sophets in the roof allow cool air into the attic.");
g_ImageTable[g_imax++] = new Array ("images/p27.jpg", "A view of the east side of the house.  Notice the low amount of window exposure.  This helps to prevent unwanted sunlight and heat each morning during the summer.");
g_ImageTable[g_imax++] = new Array ("images/p29.jpg", "A view of the west side of the house.  Like the east side of the house, there is a low amount of windows in order to minimize unwanted heat on hot summer evenings.");
g_ImageTable[g_imax++] = new Array ("images/p22.jpg", "The calculated overhang above the windows shining into the kitchen.  This is on the south face of the house.  This image was taken in mid-November.  The shadow line near the top of the windows shows how the sun is blocked from shining in during the summer, but allowed in during the winter for heat.  As the winter solstice approaches, more of the window is exposed to sunlight.");
g_ImageTable[g_imax++] = new Array ("images/p23.jpg", "Above the windows shining into the Hearth room are more calculated overhangs.");
g_ImageTable[g_imax++] = new Array ("images/p31.jpg", "Calculated overhangs protect all of the windows on the south face of the house.  Pictured here are the windows shining into the Living room, and windows shining into bedrooms on the second floor.");
g_ImageTable[g_imax++] = new Array ("images/p32.jpg", "Even windows on the basement floor are protected by calculated overhangs.");
g_ImageTable[g_imax++] = new Array ("images/p33.jpg", "A wider angle picture of the back of the house, showing the calculated overhangs.");
g_ImageTable[g_imax++] = new Array ("images/p24.jpg", "This is the 13 SEER High Efficiency Air Conditioner.  It is a five ton unit for cooling up to 3600 square feet of living space.  With a 3800 square foot house, you might think that this unit is over capacity.  However, we have found the unit to be more than adequate, because of the energy-efficient, weather-proof insulation, inside the home's walls and attic.");
g_ImageTable[g_imax++] = new Array ("images/p25.jpg", "Caulk which is applied judiciously to the exterior of the house, in order to fill all gaps in the siding and trim, minimizing air transfer to and from the house.");
g_ImageTable[g_imax++] = new Array ("images/p43.jpg", "The house is designed so that unconditioned space, such as the garage and closets, are on the north side of the house as much as possible.");
g_ImageTable[g_imax++] = new Array ("images/p44.jpg", "The setback thermostat, which is programmable.");
g_ImageTable[g_imax++] = new Array ("images/p45.jpg", "The conventional water heater, prior to the installation of a thermal blanket.");
g_ImageTable[g_imax++] = new Array ("images/p46.jpg", "The installation of the thermal blanket was a one-man jop.  Installation materials include plastic tape.");
g_ImageTable[g_imax++] = new Array ("images/p47.jpg", "The completed installation of the thermal blanket.  Installation time was about 20 minutes.");
g_ImageTable[g_imax++] = new Array ("images/p48.jpg", "The water input and output lines behind the hearth-room fireplace.  These lines provide water to the fireplace heat exchanger.  This is a view from outside the house.  Installation required the removal of an area of siding and plywood.");
g_ImageTable[g_imax++] = new Array ("images/p49.jpg", "A close-up of the water line fittings and their interface with the fireplace insulation.");
g_ImageTable[g_imax++] = new Array ("images/p50.jpg", "The input and output water line must be fed downward, through the floor to the basement.  The lines will be connected to the 150-gallon, hot-water storage tank.");
g_ImageTable[g_imax++] = new Array ("images/p51.jpg", "The water pump that provides the water supply to the fireplace heat exchanger.  This pump is adjacent to the 150 gallon, hot-water storage tank.");
g_ImageTable[g_imax++] = new Array ("images/p52.jpg", "The water line from the fireplace heat exchanger to the 150-gallon, hot water tank.");
g_ImageTable[g_imax++] = new Array ("images/p53.jpg", "The fireplace heat exchanger after the first test.  Cold water is circulated through the heat exchanger while a fire is burning so that heat from the fire is captured and stored for future use.");
g_ImageTable[g_imax++] = new Array ("images/p54.jpg", "Clearing winter snow from the driveway can be an energy-expensive task to perform.  A conventional tractor and shovel would require burning gasoline to perform the task.");
g_ImageTable[g_imax++] = new Array ("images/p55.jpg", "The emissions from a traditional four-stroke, tractor engine are harmful to the environment. (By the way, do you know what country your oil came from for the gasoline you're burning?).  However....");
g_ImageTable[g_imax++] = new Array ("images/p56.jpg", "A closer inspection of the tractor reveals that it is completely electric powered and has no emissions or fuel requirements.  This tractor obtains its energy entirely from the electricity provided by the home's solar power array.");
//extend the above list as desired
g_dwTimeOutSec = 7;

////End configuration/////////////////////////////

//moved the following line into the html code on tour.html
//if (document.getElementById || document.all) window.onload = Play
/*
var idx = 0;
var linkArray = new Array();

//load linkArray for use in the static slideshow
linkArray[idx++] =  "hext4wh.html";
linkArray[idx++] =  "p01.html"; 
linkArray[idx++] =  "p02.html";
linkArray[idx++] =  "p05.html";
linkArray[idx++] =  "p07.html";
linkArray[idx++] =  "p03.html";
linkArray[idx++] =  "p04.html";
linkArray[idx++] =  "p06.html";
linkArray[idx++] =  "p09.html";
linkArray[idx++] =  "p10.html";
linkArray[idx++] =  "p11.html";
linkArray[idx++] =  "p12.html";
linkArray[idx++] =  "p13.html";
linkArray[idx++] =  "p14.html";
linkArray[idx++] =  "p17.html";
linkArray[idx++] =  "p18.html";
linkArray[idx++] =  "p16.html";
linkArray[idx++] =  "p20.html";
linkArray[idx++] =  "p35.html";
linkArray[idx++] =  "p36.html";
linkArray[idx++] =  "p37.html";
linkArray[idx++] =  "p39.html";
linkArray[idx++] =  "p26.html";
linkArray[idx++] =  "p27.html";
linkArray[idx++] =  "p29.html";
linkArray[idx++] =  "p22.html";
linkArray[idx++] =  "p23.html";
linkArray[idx++] =  "p31.html";
linkArray[idx++] =  "p32.html";
linkArray[idx++] =  "p33.html";
linkArray[idx++] =  "p24.html";
linkArray[idx++] =  "p25.html";
linkArray[idx++] =  "p43.html";
linkArray[idx++] =  "p44.html";
linkArray[idx++] =  "p45.html";
linkArray[idx++] =  "p46.html";
linkArray[idx++] =  "p47.html";
linkArray[idx++] =  "p48.html";
linkArray[idx++] =  "p49.html";
linkArray[idx++] =  "p50.html";
linkArray[idx++] =  "p51.html";
linkArray[idx++] =  "p52.html";
linkArray[idx++] =  "p53.html";
linkArray[idx++] =  "p54.html";
linkArray[idx++] =  "p55.html";
linkArray[idx++] =  "p56.html";
*/

/*
function getFileName(searchChar)
{//function will search backwards through the location.pathname property
 //to extract the page file name and extension
 //search char can be \ or /
	var pNam = window.location.pathname;
	var ln = pName.length;
	var ch;
	var nam;
	while( ln > 0 )
	{
		ch = pName.char(ln);		
		if( ch == searchChar )
		{
			break;
		}//endif
		ln--;
	}//endwh
	return pName.sub(ln);
}//endfn
*/

/*
function curIdx( )
{//function to locate the current page in linkArray
	//var curPage = location.pathname.substring(location.pathname.lastIndexOf("/")+1);
	var cp = window.location.pathname.substring(window.location.pathname.lastIndexOf( '\\' ) + 1 );
	var ln = parseInt(linkArray.length);
	var i = 0;
	var cval;
	while(i < ln)
	{
		cval = linkArray[i];
		if( cval == cp )
		{
			idx = i;
			i = ln;
		}//endif
		i++;
	}
	return idx;
}//endfn curIdx
*/

/*
function gotoHREF( direction )
{//function to move from the current page to a page referenced in linkArray
	try {
			curIdx();
		}
	catch( exception )
	{
		alert( "exception" );
	}//endtrycatch 
	
	alert("Clicked");
	switch( direction )
	{
		case 0:	//denotes forward
		{
			if(idx == ( linkArray.length - 1 ))
			{
				idx = 0;
			}
			else
			{
				idx++;
			}//endif
			break;
		}//endcs
		case 1:	//denotes backward
		{
			if(idx == 0) 
			{
				idx = linkArray.length;
			}
			else
			{
				idx--;
			}//endif
			break;
		}//endcs
	}//endsw
	window.location.href = linkArray[ idx ];
}//endfn
*/