
image1full = new Image();
image1full.src = "/PublishingImages/home/img1.jpg";
image1h  = new Image();
image1text = new Object();
image1h.src = "/PublishingImages/home/img1_th.jpg";
image1t  = new Image();
image1t.src = "/PublishingImages/home/img1_t.jpg";
image1text = "Serving the town of Altavista, the new building of the Staunton River Memorial Library was formally opened on October 12, 1986 as a branch of the Campbell County Public Library. The building's expansion in 2004 increased the building size from 5,000 square feet to over 6,400 square feet.";

image2full = new Image();
image2text = new Object();
image2full.src = "/PublishingImages/home/img2.jpg";
image2h  = new Image();
image2h.src = "/PublishingImages/home/img2_th.jpg";
image2t  = new Image();
image2t.src = "/PublishingImages/home/img2_t.jpg";
image2text = "Red Hill Patrick Henry National Memorial near Brookneal, Virginia honors Patrick Henry, the fiery legislator and orator of the American Revolution. Henry's law office and grave are preserved at his small Red Hill plantation, along with a reconstruction of his last home, several dependencies, and a museum.";

image3full = new Image();
image3text = new Object();
image3full.src = "/PublishingImages/home/img3.jpg";
image3h  = new Image();
image3h.src = "/PublishingImages/home/img3_th.jpg";
image3t  = new Image();
image3t.src = "/PublishingImages/home/img3_t.jpg";

image3text = "A footbridge has been added to connect the English Park - Riverside section to the rest of the park. The foot bridge, located near the memorial garden in English Park-Riverside leads you to a trail that connects to the farm road and the rest of the park. This trail adds approximately 1.5 miles of trail to the park.";


image4full = new Image();
image4text = new Object();
image4full.src = "/PublishingImages/home/img4.jpg";
image4h  = new Image();
image4h.src = "/PublishingImages/home/img4_th.jpg";
image4t  = new Image();
image4t.src = "/PublishingImages/home/img4_t.jpg";

image4text = "On Campbell County's southern border is Leesville Lake, part of the Smith Mountain hydroelectric pump storage project on the Roanoke River. The lake is also a popular recreational area with fishing, boating, and waterskiing available. Since 2004, residential growth has quickly grown and lakefront homes now dot the shoreline of Leesville Lake.";


image5full = new Image();
image5text = new Object();
image5full.src = "/PublishingImages/home/img5.jpg";
image5h  = new Image();
image5h.src = "/PublishingImages/home/img5_th.jpg";
image5t  = new Image();
image5t.src = "/PublishingImages/home/img5_t.jpg";

image5text = "The land for Timbrook Park was purchased in January 2000 and planned for three stages of development. Phase 1 is complete, including sports fields, walking trails, a volleyball court, and a scenic pond. Timbrook Park is currently used by the Brookville High School cross country and soccer teams.";

boxtext = new Object();
newimg  = new Image();
newimg.src = "/depts/hr/PublishingImages/checkbox_on.gif";

boxtext = "<a href='/depts/hr/Documents/campbellco_employment_application.pdf'>Click here to download the Campbell County employment application</a>";

var blnDOMSUPPORT = (document.getElementById) ? true : false;


setTimeout(warmStart, 50);

function warmStart() {
  if (document.body)
     window_load();
  else
    setTimeout(warmStart, 50); }


function window_load()  {

	if (document.getElementById('affirm')) {

	   if ( blnDOMSUPPORT ){
			 document.getElementById('affirm').onclick = swapcheckbox; }
	   else { 
		document.images['affirm'].onclick = swapcheckbox; }

	}
   
	else if (document.getElementById('img1')) {

		   if ( blnDOMSUPPORT )  {

		      document.getElementById('img1').onclick = swapimage;
		      document.getElementById('img2').onclick = swapimage;
		      document.getElementById('img3').onclick = swapimage;
		      document.getElementById('img4').onclick = swapimage;
		      document.getElementById('img5').onclick = swapimage;

		      }
		   else  {

		      document.images['img1'].onclick = swapimage;
		      document.images['img2'].onclick = swapimage;
		      document.images['img3'].onclick = swapimage;
		      document.images['img4'].onclick = swapimage;
		      document.images['img5'].onclick = swapimage;

		      }

	   }
	}


function swapimage()  {

   if ( blnDOMSUPPORT )  {

      var imgMain = document.getElementById('mainimage');
      var img2 = document.getElementById('img2');
      var img1 = document.getElementById('img1');
      var img3 = document.getElementById('img3');
      var img4 = document.getElementById('img4');
      var img5 = document.getElementById('img5');
      var imgText = document.getElementById('imgText');
      var divParent;


      // create new image element
      var imgNew = document.createElement('img');

      // give it an image
      // here I use the src of the icon just for convenience
      // you'd want to somehow determine the src of your desired image


	if (this.id == 'img1')
		{ imgNew.src = image1full.src;
			img1.src = image1h.src;
			img2.src = image2t.src;
			img3.src = image3t.src;
			img4.src = image4t.src;
			img5.src = image5t.src;
			imgText.innerHTML = image1text;
			}
	else if (this.id == 'img2')
		{ 	imgNew.src = image2full.src;
			img1.src = image1t.src;
			img2.src = image2h.src;
			img3.src = image3t.src;
			img4.src = image4t.src;
			img5.src = image5t.src;
			imgText.innerHTML = image2text;}
	else if (this.id == 'img3')
		{ imgNew.src = image3full.src;
			img1.src = image1t.src;
			img2.src = image2t.src;
			img3.src = image3h.src;
			img4.src = image4t.src;
			img5.src = image5t.src;
			imgText.innerHTML = image3text;}
	else if (this.id == 'img4')
		{ imgNew.src = image4full.src;
			img1.src = image1t.src;
			img2.src = image2t.src;
			img4.src = image4h.src;
			img3.src = image3t.src;
			img5.src = image5t.src;
			imgText.innerHTML = image4text;}
	else if (this.id == 'img5')
		{ imgNew.src = image5full.src;
			img1.src = image1t.src;
			img2.src = image2t.src;
			img5.src = image5h.src;
			img4.src = image4t.src;
			img3.src = image3t.src;
			imgText.innerHTML = image5text;}


      // give it an id
      imgNew.id = 'mainimage';

      // replace image
      divParent = imgMain.parentNode;
      divParent.replaceChild(imgNew, imgMain);

      }
   else {

      // old school image swap
      document.images['mainimage'].src = this.src;

   }

}

function swapcheckbox() {

      var img1 = document.getElementById('affirm');
      var imgText = document.getElementById('chkboxText');
      var divParent;


      // create new image element
      var imgNew = document.createElement('img');

      // give it an image
      // here I use the src of the icon just for convenience
      // you'd want to somehow determine the src of your desired image


	if (this.id == 'affirm') {
	img1.src = newimg.src;
	imgText.innerHTML = boxtext;
	}

      // give it an id
      imgNew.id = 'affirm';

      // replace image
      divParent = img1.parentNode;
      divParent.replaceChild(newimg, img1);
}
