// JavaScript Document
	var mapPic1, mapPic2, mapPic3;
	
	function home()
	{
		var mes = document.getElementById('message');
		
		mes.innerHTML = '<div align="center"><b>Welcome . . .</b></div><br />The <b>Foothills Festival</b> (located in Albany, KY) is a fun and exciting event where you can shop for unique, hand-made arts and crafts and eat great food, but it is also an outstanding showcase of Albany\'s merchants, restaurants, and hotels. With over 75 arts, crafts and commercial vendors, 20 food vendors, great live entertainment, and a fantastic children\'s area, there is something for everyone!';
	}
	
	function contactUs()
	{
		var mes = document.getElementById('message');
		
		mes.innerHTML = 	'<div align="center"><b>Contact Us</b></div><br />Foothills Festival<br />PO Box 188<br />Albany, KY, 42602<br />Phone: 1-800-881-8589<br />Fax: 1-606-387-8724<br />E-mail: foothillsfestival@windstream.net';
	}
	
	function preload()
	{
		if (document.images)
		{
  			pic1 = new Image(676,440); 
  			pic1.src = "images/hills2.gif";
			
			pic2 = new Image(388,110);
			pic2.src = "images/header4.gif";
			
			pic3 = new Image(200,141);
			pic3.src = "images/fall-leaf-01.gif";
		}
	}
	
	function setFrom()
	{
		document.getElementById('fromAddress').value = 'Enter your City, State';
	}
	
	function dirPreload()
	{
		if (document.images)
		{
			mapPic1 = new Image(269,233); // bowling green
			mapPic1.src = "index_files/image9881.jpg";
			
			mapPic2 = new Image(271,235);
			mapPic2.src = "index_files/image2971.jpg";
			
			mapPic3 = new Image(268,232);
			mapPic3.src = "index_files/image3711.jpg";
		}
	}
	
	function showAndHideRules(val)
	{
		var op = parseInt(val,10);
		
		var divItem = new Array("pageants",
								 "baby",
								 "car",
								 "window",
								 "parade",
								 "5k",
								 "children",
								 "lipsync",
								 "lookalike",
								 "pumpkincarving",
								 "pumpkindecoration",
								 "scarecrow" );
		
		var liItem = new Array("lipageants",
							   "libabyshow",
							   "licarshow",
							   "liwindow",
							   "liparade",
							   "li5k",
							   "lichildren",
							   "lilipsync",
							   "lilookalike",
							   "lipumpkincarving",
							   "lipumpkindecor",
							   "liscarecrow" );
		
		var divSub = new Array("pageantsinfo",
							 "babyinfo",
							 "carinfo",
							 "windowinfo",
							 "paradeinfo",
							 "5kinfo",
							 "childreninfo",
							 "lipsyncinfo",
							 "lookinfo",
							 "pumpkincarvinfo",
							 "pumpkindecinfo",
							 "scarecrowinfo" );
		
		for (var i = 0; i < divSub.length; i++)
		{
			if (parseInt(i,10) == op)
			{
				document.getElementById(divSub[i]).style.display = "block";
				document.getElementById(liItem[i]).className = 'selected';
				location.href = "#tabtop1";
			}
			else
			{
				document.getElementById(divSub[i]).style.display = "none";
				document.getElementById(liItem[i]).className = '';
			}
		}
	}
	
	function hideAll()
	{
		var divSub = new Array("pageantsinfo",
							 "babyinfo",
							 "carinfo",
							 "windowinfo",
							 "paradeinfo",
							 "5kinfo",
							 "childreninfo",
							 "lipsyncinfo",
							 "lookinfo",
							 "pumpkincarvinfo",
							 "pumpkindecinfo",
							 "scarecrowinfo" );
		for (var i = 0; i < divSub.length; i++)
		{
			if (i != 0)
			{
				document.getElementById(divSub[i]).style.display = "none";
			}
		}
	}
	
	function swapDir(flag)
	{
		if (parseInt(flag,10) == 1)
		{
			document.getElementById("mapdir").style.display = "none";
			document.getElementById("locdir").style.display = "block";
		}
		else if (parseInt(flag,10) == 2)
		{
			document.getElementById("mapdir").style.display = "block";
			document.getElementById("locdir").style.display = "none";
		}
	}
	
	function swapSubDiv(flag)
	{
		if (parseInt(flag,10) == 1)
		{
			document.getElementById("locmap").src = mapPic1.src;
			document.getElementById("directions").innerHTML = '&nbsp;<b>From Bowling Green, KY</b><br /><ol><li>Take the Cumberland Parkway East towards Glasgow/Somerset.</li><li>Take the KY-90 exit (Number 14) toward Glasgow-Burkesville.</li><li>Turn right on KY-90S and go approximately 36.3 miles.</li><li>Turn right onto KY-61S/KY90S.N. Main St, continue to follow KY90 about 15 miles.</li><li>Turn right on Hwy. 127 S and travel about 4.5 miles and and you will enter the Albany Town Square.</li></ol>';
		}
		else if (parseInt(flag,10) == 2)
		{
			document.getElementById("locmap").src = mapPic2.src;
			document.getElementById("directions").innerHTML = '&nbsp;<b>From Cookeville, TN</b><br /><ol><li>Take TN-111/ TN-42 to Livington.</li><li>When in Livingston take the TN-111 bypass (McDonalds on the corner) turn left and follow bypass until it dead ends on TN-42.</li><li>Turn left to Byrdstown (18 miles), then proceed another 5 miles to the Tennessee/Kentucky state line.</li><li>At the T, Hwy. 127 you will turn left or north.</li><li>Follow 127 North about 5 miles until you reach the City of Albany.</li></ol>';
		}
		else if (parseInt(flag,10) == 3)
		{
			document.getElementById("locmap").src = mapPic3.src;
			document.getElementById("directions").innerHTML = '&nbsp;<b>From Lexington, KY</b><br /><ol><li>Drive south on Interstate I-75 until you reach the Renfro Valley/Mt. Vernon Exit.</li><li>Turn right onto 461 to Somerset.</li><li>In Somerset Take 914 Bypass to Monticello and turn left on Hwy. 27 to Hwy. 90 and turn right to Monticello.</li><li>Follow Hwy. 90 until you reach Hwy. 127 and turn left and Albany is about 5 miles straight ahead on Hwy. 127.</li></ol>';
		}
	}