
var ie4=document.all&&navigator.userAgent.indexOf("Opera")==-1
var ns6=document.getElementById&&!document.all
var ns4=document.layers
var BaseX
var BaseY

function getBaseXY(){

  var iWidth = document.body.clientWidth;
  var picWidth = 740;

  BaseX = ((iWidth-picWidth)/2);

  var iHeight = document.body.scrollTop
  var picHeight = 207;
  
  BaseY = (picHeight - iHeight);

}

function showmenu(e,which,xcor,ycor)
{

getBaseXY();

	clearhidemenu()

	menuobj=ie4? document.all.popmenu : ns6? document.getElementById("popmenu") : ns4? document.popmenu : ""
	menuobj.thestyle=(ie4||ns6)? menuobj.style : menuobj

	if (ie4||ns6)
	{
		menuobj.innerHTML=which
	}
	else
	{	
		menuobj.document.write('<layer name=gui bgColor=#E6E6E6 width=165 onmouseover="clearhidemenu()" onmouseout="hidemenu()">'+which+'</layer>')
		menuobj.document.close()
	}

	menuobj.contentwidth=(ie4||ns6)? menuobj.offsetWidth : menuobj.document.gui.document.width
	menuobj.contentheight=(ie4||ns6)? menuobj.offsetHeight : menuobj.document.gui.document.height
	eventX=ie4? event.clientX : ns6? e.clientX : e.x
	eventY=ie4? event.clientY : ns6? e.clientY : e.y

	menuobj.thestyle.left=ie4? document.body.scrollLeft+(BaseX + xcor) : ns6? window.pageXOffset+(BaseX + xcor) : eventX
	menuobj.thestyle.top=ie4? document.body.scrollTop+BaseY : ns6? window.pageYOffset+BaseY : eventY
	
	menuobj.thestyle.visibility="visible"
	
	return false
}

function contains_ns6(a, b) 
{
	//Determines if 1 element in contained in another- by Brainjar.com
	while (b.parentNode)
		if ((b = b.parentNode) == a)
			return true;
	
	return false;
}

function hidemenu()
{
	if (window.menuobj)
		menuobj.thestyle.visibility=(ie4||ns6)? "hidden" : "hide"
}

function dynamichide(e)
{
	if (ie4&&!menuobj.contains(e.toElement))
		hidemenu()
	else if (ns6&&e.currentTarget!= e.relatedTarget&& !contains_ns6(e.currentTarget, e.relatedTarget))
		hidemenu()
}

function delayhidemenu()
{
	if (ie4||ns6||ns4)
		delayhide=setTimeout("hidemenu()",750)
}

function clearhidemenu()
{
	if (window.delayhide)
		clearTimeout(delayhide)
}

function highlightmenu(e,state)
{
	if (document.all)
		source_el=event.srcElement
	else if (document.getElementById)
		source_el=e.target

	if (source_el.className=="menuitems")
		source_el.id=(state=="on")? "mouseoverstyle" : ""
	else
	{
		while(source_el.id!="popmenu")
		{
			source_el=document.getElementById? source_el.parentNode : source_el.parentElement
			if (source_el.className=="menuitems")
				source_el.id=(state=="on")? "mouseoverstyle" : ""
		}
	}
}

if (ie4||ns6)
	document.onclick=hidemenu

	function MM_reloadPage(init) //reloads the window if Nav4 resized
	{  
		if (init==true) with (navigator) 
		{
			if ((appName=="Netscape")&&(parseInt(appVersion)==4)) 
			{
				document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; 
			}
		}
		else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) 
			location.reload();
	}

	MM_reloadPage(true);
	
	function JumpPage()
	{
		location.replace(document.soimain.quick.value);
	}
	
	// Group for Secondary Links
	var group=new Array()

//group[0]='<table border="0" cellpadding="0" cellspacing="0"><tr><td colspan="5" height="1" bgcolor="#3A4470"></td></tr><tr><td width="1" bgcolor="#3A4470"></td><td bgcolor="#EDE7DD" colspan="3" height="2"></td><td width="1" bgcolor="#3A4470"></td></tr><tr><td width="1" bgcolor="#3A4470"></td><td bgcolor="EDE7DD" colspan="3" height="2"></td><td width="1" bgcolor="#3A4470"></td></tr>'
//group[0]+='<tr><td colspan="5" height="1" bgcolor="#3A4470"></td></tr></table>'

group[1]='<table border="0" cellpadding="2" cellspacing="0" width="140" bgcolor="#d6ebd9">'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Content.aspx?ID=1">Overview</a></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Schedule.aspx">Calendar of Events</a></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=10">Lodging</a></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=20">Camping</a></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=30">Attractions</a></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=40">Hunting & Fishing</a></td></tr>'
group[1]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[1]+='</table>'

group[2]='<table border="0" cellpadding="2" cellspacing="0" width="140" bgcolor="#fce8d2">'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Content.aspx?ID=2">Overview</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.clarkecountyiowa.com" Target="_blank">Clarke County</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.decaturcountydevelopment.org" Target="_blank">Decatur County</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.lucascountyiowa.com" Target="_blank">Lucas County</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.madisoncountydevelopment.com" Target="_blank">Madison County</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.ucda.us" Target="_blank">Union County</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.waynecountyiowa.com" Target="_blank">Wayne County</a></td></tr>'
group[2]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[2]+='</table>'

group[3]='<table border="0" cellpadding="2" cellspacing="0" width="140" bgcolor="#e8daeb">'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Content.aspx?ID=3">Overview</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Content.aspx?ID=6">Ag Facts</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.iowafarmbureau.com/county/default.aspx?ctyid=020&ctyname=Clarke" Target="_blank">Clarke County</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.iowafarmbureau.com/county/default.aspx?ctyid=027&ctyname=Decatur" Target="_blank">Decatur County</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.iowafarmbureau.com/county/default.aspx?ctyid=059&ctyname=Lucas" Target="_blank">Lucas County</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.iowafarmbureau.com/county/default.aspx?ctyid=061&ctyname=Madison" Target="_blank">Madison County</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.iowafarmbureau.com/county/default.aspx?ctyid=088&ctyname=Union" Target="_blank">Union County</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="http://www.iowafarmbureau.com/county/default.aspx?ctyid=093&ctyname=Wayne" Target="_blank">Wayne County</a></td></tr>'
group[3]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[3]+='</table>'

group[4]='<table border="0" cellpadding="2" cellspacing="0" width="140" bgcolor="#fad5d3">'
group[4]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[4]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Content.aspx?ID=4">Overview</a></td></tr>'
group[4]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[4]+='</table>'

group[5]='<table border="0" cellpadding="2" cellspacing="0" width="140" bgcolor="#d3e9f3">'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Content.aspx?ID=5">Overview</a></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=50">Churches</a></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=60">Education</a></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=70">Health Care</a></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=80">Cemeteries</a></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="4" height="1"><a class="navlink" href="Hospitality.aspx?ID=90">Meeting Facilities</a></td></tr>'
group[5]+='<tr><td nowrap><img src="images/spacer.gif" width="1" height="1"></td></tr>'
group[5]+='</table>'