/* ********************************* */
/* File: global.js                   */
/* Author: Carl Samuelson            */
/* Creation Date: 9/1/2009           */
/* Site: www.co.kenosha.wi.us        */
/* (c) 2009 All rights reserved      */
/* ********************************* */

// Switcher
function switcher(div)
{
	if (document.getElementById('slide1'))
	{
		var option=['slide1','slide2','slide3','slide4'];
		for(var i=0; i<option.length; i++)
		{
			obj=document.getElementById(option[i]);
			obj.style.display=(option[i]==div)? "block" : "none";
		}
	}
}
window.onload=function(){switcher('slide1');}

// Font Size Changer
var min=8;
var max=18;
function increaseFontSize()
{
	var p = document.getElementsByTagName('p');
	for(i=0;i<p.length;i++)
	{
		if(p[i].style.fontSize)
		{
			var s = parseInt(p[i].style.fontSize.replace("px",""));
		} else {
			var s = 12;
		}
		if(s!=max)
		{
			s += 1;
		}
			p[i].style.fontSize = s+"px";
	}
}

function decreaseFontSize()
{
   var p = document.getElementsByTagName('p');
   for(i=0;i<p.length;i++)
   {
      if(p[i].style.fontSize)
	  {
         var s = parseInt(p[i].style.fontSize.replace("px",""));
      } else {
         var s = 12;
      }
      if(s!=min)
	  {
         s -= 1;
      }
      p[i].style.fontSize = s+"px";
   }   
}

// Random Banner Image Changer
function showImage()
{
	var theImages = new Array();
	theImages[0] = '/images/banner1.gif';
	theImages[1] = '/images/banner2.gif';
	theImages[2] = '/images/banner3.gif';
	theImages[3] = '/images/banner4.gif';
	var j = 0;
	var p = theImages.length;
	var preBuffer = new Array()
	for (i = 0; i < p; i++)
	{
   		preBuffer[i] = new Image();
   		preBuffer[i].src = theImages[i];
	}
	var whichImage = Math.round(Math.random()*(p-1));
	document.write('<img src="'+theImages[whichImage]+'">');
}
