//Begin dropdown script -initialize array
//Contents for menu 1
var menu1=new Array()
menu1[0]='<span class="grey-11px">></span> <a href="index_wachistory.html?pid=1" class="grey-11px">Brown Book</a><br>';
menu1[1]='<span class="grey-11px">></span> <a href="index_wachistory.html?pid=2" class="grey-11px">Council of Directors</a><br>';
menu1[2]='<span class="grey-11px">></span> <a href="index_wachistory.html?pid=3" class="grey-11px">Watershed Partners</a><br>';
menu1[3]='<span class="grey-11px">></span> <a href="index_wachistory.html?pid=4" class="grey-11px">Green Book</a><br>';
menu1[4]='<span class="grey-11px">></span> <a href="index_wachistory.html?pid=5" class="grey-11px">Office and Field Staff</a><br>';
//Contents for menu 2
var menu2=new Array()
menu2[0]='<span class="grey-11px">></span> <a href="clw_bmps.html" class="grey-11px">Best Management <br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">Practices</a><br>';
menu2[1]='<span class="grey-11px">></span> <a href="clw_wholefarmplanning.html" class="grey-11px">Whole Farm <br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">Planning</a><br>';
menu2[2]='<span class="grey-11px">></span> <a href="clw_logger.html" class="grey-11px">Logger Training</a><br>';
menu2[3]='<span class="grey-11px">></span> <a href="clw_small.html" class="grey-11px">Small Farms Program</a><br>';
menu2[4]='<span class="grey-11px">></span> <a href="clw_croton.html" class="grey-11px">East Of Hudson Program</a><br>';
menu2[5]='<span class="grey-11px">></span> <a href="clw_agricultural.html" class="grey-11px">Agricultural Research</a><br>';
//Contents for menu 3
var menu3=new Array()
menu3[0]='<span class="grey-11px">></span> <a href=lc_fmp.html class="grey-11px">Forest Management <br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">Planning</a><br>';
menu3[1]='<span class="grey-11px">></span> <a href=lc_crep.html class="grey-11px">Stream Buffers</a><br>';
menu3[2]='<span class="grey-11px">></span> <a href=lc_parcelization.html class="grey-11px">Parcelization</a><br>';
menu3[3]='<span class="grey-11px">></span> <a href=lc_agricultural.html class="grey-11px">Easements</a><br>';
//Contents for menu 4
/*var menu4=new Array()
menu4[0]='<span class="grey-11px">></span> <a href=re_model.html class="grey-11px">Model Forest</a><br>';
menu4[1]='<span class="grey-11px">></span> <a href=re_town.html class="grey-11px">Town Brook Group</a><br>';
menu4[2]='<span class="grey-11px">></span> <a href=re_paired.html class="grey-11px">Paired Watershed</a><br>';
menu4[3]='<span class="grey-11px">></span> <a href=re_solar.html class="grey-11px">Solar Calf Housing</a><br>';
menu4[4]='<span class="grey-11px">></span> <a href=re_manure.html class="grey-11px">Manure Management</a><br>';
menu4[5]='<span class="grey-11px">></span> <a href=re_starter.html class="grey-11px">Starter P Project</a><br>';
menu4[6]='<span class="grey-11px">></span> <a href=re_grass.html class="grey-11px">Grass and Hay <br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">Fertility</a><br>';
menu4[7]='<span class="grey-11px">></span> <a href=re_cover.html class="grey-11px">Cover Crops Study</a><br>';*/
//Contents for menu 4
var menu4=new Array()
menu4[0]='<span class="grey-11px">></span> <a href=ei_forestry_grants.html class="grey-11px">Forestry Market<br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">Development</a><br>';
menu4[1]='<span class="grey-11px">></span> <a href=ei_market.html class="grey-11px">Farm To Market <br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">Projects</a><br>';
menu4[2]='<span class="grey-11px">></span> <a href=ei_farm.html class="grey-11px">Farm Beautification</a><br>';
menu4[3]='<span class="grey-11px">></span> <a href=ei_food.html class="grey-11px">Buy Pure Catskills</a><br>';
//Contents for menu 5
var menu5=new Array()
menu5[0]='<span class="grey-11px">></span> <a href=edu_model.html class="grey-11px">Model Forests</a><br>';
menu5[1]='<span class="grey-11px">></span> <a href=edu_farmer.html class="grey-11px">Farmer Education</a><br>';
menu5[2]='<span class="grey-11px">></span> <a href=edu_loggers.html class="grey-11px">Foresters, Loggers <br><img src="Assets/images/spacer.gif" width="13" height="5" border="0">and Landowners</a><br>';
menu5[3]='<span class="grey-11px">></span> <a href=edu_teachers.html class="grey-11px">Teachers\' Institute</a><br>';
menu5[4]='<span class="grey-11px">></span> <a href=edu_greenconnect.html class="grey-11px">Green Connections</a><br>';
menu5[5]='<span class="grey-11px">></span> <a href=edu_tours.html class="grey-11px">School Tours</a><br>';
//Contents for menu 6
var menu6=new Array()
menu6[0]='<span class="grey-11px">></span> <a href=wac_news_farm.html class="grey-11px">Farm</a><br>';
menu6[1]='<span class="grey-11px">></span> <a href=wac_news_forestry.html class="grey-11px">Forestry</a><br>';
menu6[2]='<span class="grey-11px">></span> <a href=wac_news_support.html class="grey-11px">Support Us</a><br>';

/*
var menu7=new Array()
menu7[0] = '<span class="grey-11px">></span> <a href="" class="grey-11px">Watershed Forestry Program</a><br>';
menu7[1] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Forest Management Plan </a><br>'
menu7[2] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Watershed Tours </a><br>'
menu7[3] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Find A Forester </a><br>'
menu7[4] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Education (Foresters, Loggers, Landowners) </a><br>'
menu7[5] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Virtual Forest Tour </a><br>'
menu7[6] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Logger Training </a><br>'
menu7[7] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Model Forest </a><br>'
menu7[8] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Teachers Institute </a><br>'
menu7[9] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Green Connections </a><br>'
menu7[10] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Forestry Grants Program </a><br>'
menu7[11] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Buy Local Wood Directory </a><br>'

menu7[12] = '<span class="grey-11px">></span> <a href="" class="grey-11px"> Watershed Agricultural Program </a><br>'
menu7[13] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Whole Farm Planning </a><br>'
menu7[14] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Small Farms Program </a><br>'
menu7[15] = '&nbsp;&nbsp;&nbsp;&nbsp;<span class="grey-11px">></span> <a href="" class="grey-11px"> Croton Farms Initiative</a><br>'

menu7[16] = '<span class="grey-11px">></span> <a href="" class="grey-11px"> Agricultural Easements </a><br>'

menu7[17] = '<span class="grey-11px">></span> <a href="" class="grey-11px"> Economic Initiatives </a><br>'
*/
// end DROP DOWN SCRIPT

var menuwidth='165px'; //default menu width
var menubgcolor='#ffffff';  //menu bgcolor
var disappeardelay=10;  //menu disappear speed onMouseout (in miliseconds)
var hidemenu_onclick="yes"; //hide menu when user clicks within menu?

/////No further editting needed

var ie4=document.all
var ns6=document.getElementById&&!document.all

if (ie4||ns6){
	str = '<div id="dropmenudiv1" style="position:absolute; font:normal 12px Verdana; line-height:16px; z-index:100; layer-background-color:' + menubgcolor + '; border:1px solid gray; padding: 5px 3px 10px 5px; visibility:hidden; width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event, dropmenuobj1)">';
	for (i=0;i<menu1.length;i++){
		str += menu1[i]
	}
	str += '</div>'
	
	str += '<div id="dropmenudiv2" style="position:absolute; font:normal 12px Verdana; line-height:16px; z-index:100; layer-background-color:' + menubgcolor + '; border:1px solid gray; padding: 5px 3px 10px 5px; visibility:hidden; width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event, dropmenuobj2)">';
	for (i=0;i<menu2.length;i++){
		str += menu2[i]
	}
	str += '</div>'
	
	str += '<div id="dropmenudiv3" style="position:absolute; font:normal 12px Verdana; line-height:16px; z-index:100; layer-background-color:' + menubgcolor + '; border:1px solid gray; padding: 5px 3px 10px 5px; visibility:hidden; width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event, dropmenuobj3)">';
	for (i=0;i<menu3.length;i++){
		str +=  menu3[i]
	}
	str += '</div>'
	
	str += '<div id="dropmenudiv4" style="position:absolute; font:normal 12px Verdana; line-height:16px; z-index:100; layer-background-color:' + menubgcolor + '; border:1px solid gray; padding: 5px 3px 10px 5px; visibility:hidden; width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event, dropmenuobj4)">';
	for (i=0;i<menu4.length;i++){
		str += menu4[i]
	}
	str += '</div>'
	
	str += '<div id="dropmenudiv5" style="position:absolute; font:normal 12px Verdana; line-height:16px; z-index:100; layer-background-color:' + menubgcolor + '; border:1px solid gray; padding: 5px 3px 10px 5px; visibility:hidden; width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event, dropmenuobj5)">';
	for (i=0;i<menu5.length;i++){
		str += menu5[i]
	}
	str += '</div>'
	
	str += '<div id="dropmenudiv6" style="position:absolute; font:normal 12px Verdana; line-height:16px; z-index:100; layer-background-color:' + menubgcolor + '; border:1px solid gray; padding: 5px 3px 10px 5px; visibility:hidden; width:'+menuwidth+'" onMouseover="clearhidemenu()" onMouseout="dynamichide(event, dropmenuobj6)">';
	for (i=0;i<menu6.length;i++){
		str += menu6[i]
	}
	str += '</div>'
	
	document.write(str)
}


dropmenuobj1=document.getElementById? document.getElementById('dropmenudiv1') : dropmenudiv1
dropmenuobj2=document.getElementById? document.getElementById('dropmenudiv2') : dropmenudiv2
dropmenuobj3=document.getElementById? document.getElementById('dropmenudiv3') : dropmenudiv3
dropmenuobj4=document.getElementById? document.getElementById('dropmenudiv4') : dropmenudiv4
dropmenuobj5=document.getElementById? document.getElementById('dropmenudiv5') : dropmenudiv5
dropmenuobj6=document.getElementById? document.getElementById('dropmenudiv6') : dropmenudiv6
//dropmenuobj7=document.getElementById? document.getElementById('dropmenudiv7') : dropmenudiv7
//alert(dropmenuobj7);


function getposOffset(what, offsettype){
	var totaloffset=(offsettype=="left")? what.offsetLeft : what.offsetTop;
	var parentEl=what.offsetParent;
	while (parentEl!=null){
	totaloffset=(offsettype=="left")? totaloffset+parentEl.offsetLeft : totaloffset+parentEl.offsetTop;
	parentEl=parentEl.offsetParent;
	}
	return totaloffset;
}


function showhide(obj, e, visible, hidden, menuwidth, menu){
	if (ie4||ns6){
		menu.style.left=menu.style.top=-500
	}
	if (menuwidth!=""){
		menu.widthobj=menu.style
		menu.widthobj.width=menuwidth
	}
	if (e.type=="click" && obj.visibility==hidden || e.type=="mouseover"){
		obj.visibility=visible
	} else if (e.type=="click") {
		obj.visibility=hidden;
	}
}

function iecompattest(){
	return (document.compatMode && document.compatMode!="BackCompat")? document.documentElement : document.body
}

function clearbrowseredge(obj, whichedge, menu){
	var edgeoffset=0
	if (whichedge=="rightedge"){
	var windowedge=ie4 && !window.opera? iecompattest().scrollLeft+iecompattest().clientWidth-15 : window.pageXOffset+window.innerWidth-15
	menu.contentmeasure=menu.offsetWidth
	if (windowedge-menu.x < menu.contentmeasure)
	edgeoffset=menu.contentmeasure-obj.offsetWidth
	}
	else{
	var windowedge=ie4 && !window.opera? iecompattest().scrollTop+iecompattest().clientHeight-15 : window.pageYOffset+window.innerHeight-18
	menu.contentmeasure=menu.offsetHeight
	if (windowedge-menu.y < menu.contentmeasure)
	edgeoffset=menu.contentmeasure+obj.offsetHeight
	}
	return edgeoffset
}

function populatemenu(what){
	if (ie4||ns6){
		//dropmenuobj.innerHTML=what.join("");
	}
}


function dropdownmenu(obj, e, menucontents, divname, menuwidth, menu){
	if (typeof prevMenu!="undefined"){
	if (ie4||ns6)
	prevMenu.style.visibility="hidden"
	}
	
	if (window.event) event.cancelBubble=true
	else if (e.stopPropagation) e.stopPropagation()
	clearhidemenu()
	
	//menu=document.getElementById? document.getElementById(divname) : divname
	populatemenu(menucontents)
	
	if (ie4||ns6){
	showhide(menu.style, e, "visible", "hidden", menuwidth, menu)
	menu.x=getposOffset(obj, "left")
	menu.y=getposOffset(obj, "top") - 1
	menu.style.left=menu.x-clearbrowseredge(obj, "rightedge", menu)+"px"
	menu.style.top=menu.y-clearbrowseredge(obj, "bottomedge", menu)+obj.offsetHeight+"px"
	}
	prevMenu = menu;
	return clickreturnvalue()
}

function clickreturnvalue(){
	if (ie4||ns6) return false
	else return true
}

function contains_ns6(a, b) {
	//alert(b.parentNode)
	
	while (b.parentNode)
	//alert(b.parentNode);
	if ((b = b.parentNode) == a)
	return true;
	return false;
}

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

function hidemenu(){
	if (typeof prevMenu!="undefined"){
	if (ie4||ns6)
	prevMenu.style.visibility="hidden"
	}
}

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

function clearhidemenu(){
	if (typeof delayhide!="undefined")
	clearTimeout(delayhide)
}

//if (hidemenu_onclick=="yes")
//document.onclick=hidemenu



//jump to

function jumpto(val){
	if (val.length > 0){
		valarr=val.split("::")
		if (valarr.length > 1){
			dimension = valarr[1].split(",")
			open_pop(valarr[0],'wind', dimension[0], dimension[1])
		} else {
			window.location.href = valarr[0]
		}
	}
	//alert(valarr.length);
}

//if you are a

function ifyouarea(val){
	if (val.length > 0){
		valarr=val.split("::")
		if (valarr.length > 1){
			dimension = valarr[1].split(",")
			open_pop(valarr[0],'wind', dimension[0], dimension[1])
		} else {
			window.location.href = valarr[0]
		}
	}
	//alert(valarr.length);
}