function go_to_site(form) { 
var index=form.selector.selectedIndex
if (form.selector.options[index].value != "0") {
location=form.selector.options[index].value;}}

function go_to_state(form) { 
	var index=form.state.selectedIndex
	if (form.state.options[index].value != "0") {
		location="trymm.cgi?sid=" + form.state.options[index].value;
	}
}

function go_to_country(form) { 
	var index=form.country.selectedIndex
	if (form.country.options[index].value != "0") {
		location="trymm.cgi?cid=" + form.country.options[index].value;
	}	
}

    var accordionItems = new Array();

    function init() {

      // Grab the accordion items from the page
      var divs = document.getElementsByTagName( 'div' );
      for ( var i = 0; i < divs.length; i++ ) {
        if ( divs[i].className == 'accordionItem' ) accordionItems.push( divs[i] );
      }

      // Assign onclick events to the accordion item headings
      for ( var i = 0; i < accordionItems.length; i++ ) {
        var h2 = getFirstChildWithTagName( accordionItems[i], 'H2' );
        h2.onclick = toggleItem;
      }

      // Hide all accordion item bodies except the first
      for ( var i = 1; i < accordionItems.length; i++ ) {
        accordionItems[i].className = 'accordionItem hide';
      }
    }

    function toggleItem() {
      var itemClass = this.parentNode.className;

      // Hide all items
      for ( var i = 0; i < accordionItems.length; i++ ) {
        accordionItems[i].className = 'accordionItem hide';
      }

      // Show this item if it was previously hidden
      if ( itemClass == 'accordionItem hide' ) {
        this.parentNode.className = 'accordionItem';
      }
    }

    function getFirstChildWithTagName( element, tagName ) {
      for ( var i = 0; i < element.childNodes.length; i++ ) {
        if ( element.childNodes[i].nodeName == tagName ) return element.childNodes[i];
      }
    }
	
function toggleBox(szDivID, iState) // 1 visible, 0 hidden
{
    if(document.layers)	   //NN4+
    {
       document.layers[szDivID].visibility = iState ? "show" : "hide";
    }
    else if(document.getElementById)	  //gecko(NN6) + IE 5+
    {
        var obj = document.getElementById(szDivID);
        obj.style.visibility = iState ? "visible" : "hidden";
    }
    else if(document.all)	// IE 4
    {
        document.all[szDivID].style.visibility = iState ? "visible" : "hidden";
    }
}

var rand = 0;
var rand1 = 0;
var useRand = 0;
var useRand1 = 0;

images = new Array();
images[1] = new Image();
images[1].src = "/images/sidepics/churchnowalls.jpg";
images[2] = new Image();
images[2].src = "/images/sidepics/Congo.2008.truck1.jpg";
images[2].title = "Congregations in Oregon and Illinois purchase and send a truck to the Congo";
images[3] = new Image();
images[3].src = "/images/sidepics/Congo.2008.truck2.jpg";
images[3].title = "Congregations in Oregon and Illinois purchase and send a truck to the Congo";
images[4] = new Image();
images[4].src = "/images/sidepics/IL.India.2007.kids.jpg";
images[4].title = "A congregation in Illinois bike through India to raise money for a new hospital";
images[5] = new Image();
images[5].src = "/images/sidepics/IL.India.2007.newbirth.jpg";
images[5].title = "A congregation in Illinois bike through India to raise money for a new hospital";
images[6] = new Image();
images[6].src = "/images/sidepics/IL.India.2007.onroad.jpg";
images[6].title = "A congregation in Illinois bike through India to raise money for a new hospital";
images[7] = new Image();
images[7].src = "/images/sidepics/IL.Liberia.2005.children1.jpg";
images[7].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[8] = new Image();
images[8].src = "/images/sidepics/IL.Liberia.2005.children2.jpg";
images[8].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[9] = new Image();
images[9].src = "/images/sidepics/IL.Liberia.2005.coconuts.jpg";
images[9].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[10] = new Image();
images[10].src = "/images/sidepics/IL.Liberia.2005.dadchild.jpg";
images[10].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[11] = new Image();
images[11].src = "/images/sidepics/IL.Liberia.2005.girl.jpg";
images[11].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[12] = new Image();
images[12].src = "/images/sidepics/IL.Liberia.2005.girl1.jpg";
images[12].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[13] = new Image();
images[13].src = "/images/sidepics/IL.Liberia.2005.girl2.jpg";
images[13].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[14] = new Image();
images[14].src = "/images/sidepics/IL.Liberia.2005.girl3.jpg";
images[14].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[15] = new Image();
images[15].src = "/images/sidepics/IL.Liberia.2005.girl4.jpg";
images[15].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[16] = new Image();
images[16].src = "/images/sidepics/IL.Liberia.2005.headfruit.jpg";
images[16].title = "A congregation in Illinois cared for the needs of children in an orphanage in Liberia";
images[17] = new Image();
images[17].src = "/images/sidepics/IL.Liberia.2005.working.jpg";
images[17].title = "Congregation in Indiana aids with health issues in Kenya";
images[18] = new Image();
images[18].src = "/images/sidepics/IN.Kenya.2009.bball.jpg";
images[18].title = "Congregation in Indiana aids with health issues in Kenya";
images[19] = new Image();
images[19].src = "/images/sidepics/IN.Kenya.2009.building.jpg";
images[19].title = "Congregation in Indiana aids with health issues in Kenya";
images[20] = new Image();
images[20].src = "/images/sidepics/IN.Kenya.2009.church.jpg";
images[20].title = "Congregation in Indiana aids with health issues in Kenya";
images[21] = new Image();
images[21].src = "/images/sidepics/IN.Kenya.2009.crowd.jpg";
images[21].title = "Congregation in Indiana aids with health issues in Kenya";
images[22] = new Image();
images[22].src = "/images/sidepics/IN.Kenya.2009.dig.jpg";
images[22].title = "Congregation in Indiana aids with health issues in Kenya";
images[23] = new Image();
images[23].src = "/images/sidepics/IN.Kenya.2009.friends.jpg";
images[23].title = "Congregation in Indiana aids with health issues in Kenya";
images[24] = new Image();
images[24].src = "/images/sidepics/IN.Kenya.2009.girls.jpg";
images[24].title = "Congregation in Indiana aids with health issues in Kenya";
images[25] = new Image();
images[25].src = "/images/sidepics/IN.Kenya.2009.give.jpg";
images[25].title = "Congregation in Indiana aids with health issues in Kenya";
images[26] = new Image();
images[26].src = "/images/sidepics/IN.Kenya.2009.group.jpg";
images[26].title = "Congregation in Indiana aids with health issues in Kenya";
images[27] = new Image();
images[27].src = "/images/sidepics/IN.Kenya.2009.jpg";
images[27].title = "Congregation in Indiana aids with health issues in Kenya";
images[28] = new Image();
images[28].src = "/images/sidepics/IN.Kenya.2009.kids.jpg";
images[28].title = "Congregation in Indiana aids with health issues in Kenya";
images[29] = new Image();
images[29].src = "/images/sidepics/IN.Kenya.2009.kids2.jpg";
images[29].title = "Congregation in Indiana aids with health issues in Kenya";
images[30] = new Image();
images[30].src = "/images/sidepics/IN.Kenya.2009.meet.jpg";
images[30].title = "Congregation in Indiana aids with health issues in Kenya";
images[31] = new Image();
images[31].src = "/images/sidepics/IN.Kenya.2009.people.jpg";
images[31].title = "Congregation in Indiana aids with health issues in Kenya";
images[32] = new Image();
images[32].src = "/images/sidepics/IN.Kenya.2009.people2.jpg";
images[32].title = "Congregation in Indiana aids with health issues in Kenya";
images[33] = new Image();
images[33].src = "/images/sidepics/IN.Kenya.2009.people3.jpg";
images[33].title = "Congregation in Indiana aids with health issues in Kenya";
images[34] = new Image();
images[34].src = "/images/sidepics/NY.Kenya.2007.construction.jpg";
images[34].title = "";
images[35] = new Image();
images[35].src = "/images/sidepics/IN.Kenya.2009.sitting.jpg";
images[35].title = "Congregation in Indiana aids with health issues in Kenya";
images[36] = new Image();
images[36].src = "/images/sidepics/IN.Kenya.2009.toy.jpg";
images[35].title = "Congregation in Indiana aids with health issues in Kenya";
images[37] = new Image();
images[37].src = "/images/sidepics/IN.Mexico.carry.jpg";
images[38] = new Image();
images[38].src = "/images/sidepics/IN.Mexico.kids.jpg";
images[39] = new Image();
images[39].src = "/images/sidepics/MN.Nicaragua.2007.baby.jpg";
images[40] = new Image();
images[40].src = "/images/sidepics/MN.Nicaragua.2007.baptism.jpg";
images[41] = new Image();
images[41].src = "/images/sidepics/MN.Nicaragua.2007.boy.jpg";
images[42] = new Image();
images[42].src = "/images/sidepics/MN.Nicaragua.2007.earcare.jpg";
images[43] = new Image();
images[43].src = "/images/sidepics/MN.Nicaragua.2007.handshake.jpg";
images[44] = new Image();
images[44].src = "/images/sidepics/MN.Nicaragua.2007.littlegirl.jpg";
images[45] = new Image();
images[45].src = "/images/sidepics/MN.Nicaragua.2007.nurse.jpg";
images[46] = new Image();
images[46].src = "/images/sidepics/MN.Nicaragua.2007.patient2.jpg";
images[47] = new Image();
images[47].src = "/images/sidepics/IN.USA.2006.building.jpg";
images[48] = new Image();
images[48].src = "/images/sidepics/IN.USA.2006.construction.jpg";
images[49] = new Image();
images[49].src = "/images/sidepics/IN.USA.2006.display.jpg";
images[50] = new Image();
images[50].src = "/images/sidepics/IN.USA.2006.people.jpg";
images[51] = new Image();
images[51].src = "/images/sidepics/OH.DR.2007.construction.jpg";
images[52] = new Image();
images[52].src = "/images/sidepics/OH.DR.2007.construction2.jpg";
images[53] = new Image();
images[53].src = "/images/sidepics/OH.DR.2007.construction3.jpg";
images[54] = new Image();
images[54].src = "/images/sidepics/OH.DR.2007.construction5.jpg";
images[55] = new Image();
images[55].src = "/images/sidepics/OH.DR.2007.construction6.jpg";
images[56] = new Image();
images[56].src = "/images/sidepics/OH.DR.2007.construction7.jpg";
images[57] = new Image();
images[57].src = "/images/sidepics/OH.DR.2007.construction8.jpg";
images[58] = new Image();
images[58].src = "/images/sidepics/OH.DR.2007.construction9.jpg";
images[59] = new Image();
images[59].src = "/images/sidepics/OH.DR.2007.roof.jpg";
images[60] = new Image();
images[60].src = "/images/sidepics/OH.DR2007.construction11.jpg";
images[61] = new Image();
images[61].src = "/images/sidepics/OH.USA.2005.foodline.jpg";
images[62] = new Image();
images[62].src = "/images/sidepics/OH.USA.2005.foodline2.jpg";
images[63] = new Image();
images[63].src = "/images/sidepics/OH.USA.2005.foodline3.jpg";
images[64] = new Image();
images[64].src = "/images/sidepics/OH.USA.2005.kitchen.jpg";
images[65] = new Image();
images[65].src = "/images/sidepics/MN.Nicaragua.2007.people.jpg";
images[66] = new Image();
images[66].src = "/images/sidepics/MN.Nicaragua.2007.rain.jpg";
images[67] = new Image();
images[67].src = "/images/sidepics/MN.Nicaragua.2007.woman.jpg";
images[68] = new Image();
images[68].src = "/images/sidepics/MN.Nicaragua.2007.woman1.jpg";
images[69] = new Image();
images[69].src = "/images/sidepics/MN.Nicaragua.2007.woman2.jpg";
images[70] = new Image();
images[70].src = "/images/sidepics/MN.Nicaragua.2007.woman3.jpg";
images[71] = new Image();
images[71].src = "/images/sidepics/NY.Kenya.2007.boy.jpg";
images[72] = new Image();
images[72].src = "/images/sidepics/NY.Kenya.2007.construction.jpg";

function swapPic() {
var imgnum = images.length - 1;
while (rand == rand1) {
var randnum = Math.random();
var randnum1 = Math.random();
rand = Math.round((imgnum - 1) * randnum) + 1;
rand1 = Math.round((imgnum - 1) * randnum1) + 1;
}
useRand = rand;
useRand1 = rand1;
document.randimg.src = images[useRand].src;
document.randimg.title = images[useRand].title;
document.randimg1.src = images[useRand1].src;
document.randimg1.title = images[useRand1].title;
}

function alljavascript(){
init();
swapPic();
displayTitle();
}