//Navigation Bar Construct
function move_it()
	{
	var the_url = document.the_form.the_select.value
	window.location.assign(the_url);
	}

//***************************************************\\
//Preloads Images to ensure smoothness of events
//Coded by: Daniel Pickett
//Notice: Do not duplicate without written consent 
//Property of Pica Web Design
//***************************************************\\

//Note!!! all images must be named correctly.  
//ex.
//home.gif
//home-over.gif
//home-click.gif

function newImage(image_name,image_src)
	{
		if (document.images)
		{
		image_name = new Image();
		image_name.src = image_src;
		return image_name;
		}
	}

function preload_it()
{
var preload_images = false;
if (document.images)
	{
	//insert image name, url pairs here as a parameter of newImage()
	newImage("comm_outreach","images/comm_outreach.gif");
	newImage("comm_outreach","images/comm_outreach-over.gif");
	newImage("youth","images/youth.gif");
	newImage("youth","images/youth.gif");
	newImage("seniors","images/seniors.gif");
	newImage("seniors","images/seniors-over.gif");
	newImage("family","images/family.gif");
	newImage("family","images/family-over.gif");
	newImage("protection","images/protection.gif");
	newImage("protection","images/protection.gif");

	//end image urls
	}
var preload_images = true;
return preload_images;
}
	
//onmouseover event
function on_over(image_name)
	{
	if (preload_it() == true)
		{
		image_src = "images/" + image_name + "-over.gif";
		document[image_name].src = image_src;
		}
	}
	
//onmousedown event
function on_down(image_name)
	{
	if (preload_it() == true)	
		{
		image_src = "images/" + image_name + "-click.gif";
		document[image_name].src = image_src;
		}
	}
	
//onmouseout event
function on_out(image_name)
	{
	if (preload_it() == true)
		{
		image_src = "images/" + image_name + ".gif";
		document[image_name].src = image_src
		}
	}

//Go to the selected site upon submission
function move_it()
	{
	var the_url = document.the_form.the_select.value
	window.location.assign(the_url);
	}

//Pop up for announcement
function announce_it()
	{
	var annURL = "award.htm"
	window.open(annURL, "Announce", "height=375, width=300, resizable=yes");
	}

//Close pop up and goto story
function GoToStory()
	{
	window.close("Announce");
	window.open("AwardStory.htm", "announceWIN");
	}

//Window Open For Town Info
function open_win(URL)
	{
	var complete_url = "http://www.state.ma.us/cc/" + URL;
	window.open(complete_url, "Town_info", "height=400, width=550, scrollbars=yes");
	}

//Window Close For Town Info
function close_win()
	{
	window.close("Town_info");
	}

//Pull Down Mechanics
if (document.layers) {

  visible = 'show';

  hidden = 'hide';

} 

//if MSIE make adjustments
else if (document.all) {

  visible = 'visible';

  hidden = 'hidden';

}

//Actually Toggles Pull down off and on
//Parameter menu must be 'single quoted' (Div id)
function shade(menu) {

  if (document.layers) {

    var the_menu = document.layers[menu];

  } else if (document.all) {

    the_menu = document.all(menu).style;

  }

  if (the_menu.visibility == visible) {

    the_menu.visibility = hidden;

  } else {

    the_menu.visibility = visible;

  }
  }