var mac = (navigator.platform.indexOf('Win') == -1) ? true : false;
var ie = document.all ? true : false;
var n6 = document.getElementById ? true : false;
var n4 = document.layers ? true : false;
if (ie) {mcenter = document.body.clientWidth / 2; mright = document.body.clientWidth;}
else if (n6) {mcenter = window.innerWidth / 2; mright = window.innerWidth;}
else if (n4) {mcenter = window.innerWidth / 2; mright = window.innerWidth;}
if (mcenter < 353) {mcenter = 353;}

var mnumber = new Array();
var hiddens = new Array();
var closing = new Array();
var mparent = new Array();
for (i=0; i<=1; i++)
{
	mnumber[i] = 0;
	hiddens[i] = new Array();
	closing[i] = new Array();
	mparent[i] = new Array();
}

function displayMenu(type,which)
{
	clearTimeout(closing[type][which]);
	if (ie) {eval("menu" + type + "_" + which + ".style.visibility = 'visible'");}
	else if (n6) {eval("document.getElementById('menu" + type + "_" + which + "').style.visibility = 'visible'");}
	else if (n4) {eval("document.menu" + type + "_" + which + ".visibility = 'visible'");}
	for (i=0; i<hiddens[type].length; i++)
	{
		if (i != which) {hideMenu(type,i);}
	}
	hiddens[type][which] = false;
}

function delayHide(type,which)
{
	clearTimeout(closing[type][which]);
	closing[type][which] = setTimeout('hideMenu(' + type + ',' + which + ')',300);
}

function hideAll(type)
{
	for (i=0; i<hiddens[type].length; i++)
	{
		hideMenu(type,i);
	}
}

function hideMenu(type,which)
{
	clearTimeout(closing[type][which]);
	if (ie) {eval("menu" + type + "_" + which + ".style.visibility = 'hidden'");}
	else if (n6) {eval("document.getElementById('menu" + type + "_" + which + "').style.visibility = 'hidden'");}
	else if (n4) {eval("document.menu" + type + "_" + which + ".visibility = 'hidden'");}
	hiddens[type][which] = true;
}

function createMenu(type,mtop,mleft,labellist,linklist)
{
	ptype = type - 1;
	ctype = type + 1;
	var labels = labellist.split('|');
	var links = linklist.split('|');
	var mheight = labels.length * 17 + 4;
	displaym = (type > 0) ? 'displayMenu('+ptype+','+mparent[type][mnumber[type]]+');' : '';
	delaym = (type > 0) ? 'delayHide('+ptype+','+mparent[type][mnumber[type]]+');' : '';

	if (ie || n6) {document.write('<DIV id="menu'+type+'_'+mnumber[type]+'" style="TOP:'+mtop+'; LEFT:' + mleft + '; VISIBILITY:hidden; OVERFLOW:hidden; POSITION:absolute; Z-INDEX:3;" onMouseOver = "displayMenu('+type+','+mnumber[type]+');'+displaym+'" onMouseOut = "delayHide('+type+','+mnumber[type]+');'+delaym+'">');}
	else if (n4) {document.write('<LAYER id="menu'+type+'_'+mnumber[type]+'" TOP="'+mtop+'" LEFT="' + mleft + '" HEIGHT="'+mheight+'" WIDTH="240" CLIP="240,'+mheight+'" VISIBILITY="hide" onMouseOver = "displayMenu('+type+','+mnumber[type]+');'+displaym+'" onMouseOut = "delayHide('+type+','+mnumber[type]+');'+delaym+'" Z-INDEX="3">');}
	document.write('<table border="0" cellpadding="1" cellspacing="0">');
	document.write('<tr><td bgcolor="#666666"><table border="0" cellpadding="0" cellspacing="0">');
	document.write('<tr><td colspan="3" height="1" bgcolor="#ffffff"><img src="image/verbose.gif" width="1" height="1" border="0" hspace="0" vspace="0"></td></tr>');
	document.write('<tr><td width="1" bgcolor="#ffffff"><img src="image/verbose.gif" width="1" height="1" border="0" hspace="0" vspace="0"></td>');
	document.write('<td><table border="0" cellpadding="0" cellspacing="0">');
	for (i=0; i<labels.length; i++)
	{
		var linkinfo = links[i].split('^');
		if (ie) {usestyle = 'mainmenu';}
		else if (n6) {usestyle = 'mainmenun6';}
		else if (n4) {usestyle = 'mainmenu';}
		if (linkinfo[1])
		{
			mparent[ctype][linkinfo[1]] = mnumber[type];
			if (ie || n6)
			{
				document.write('<tr><td class="subarrow" bgcolor="#ffffff" onMouseOver="this.bgColor=\'#339933#\'" onMouseOut="this.bgColor=\'#ffffff\'" height="16"><a onMouseOver="displayMenu('+ctype+','+linkinfo[1]+')" onMouseOut="delayHide('+ctype+','+linkinfo[1]+')" class="' + usestyle + '" href="'+linkinfo[0]+'">&nbsp;'+labels[i]+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td></tr><tr><td height="1"><img src="http://www.sripmc.org/image/verbose.gif" width="1" height="1" border="0" hspace="0" vspace="0"></td></tr>');
			}
			else if (n4)
			{
				document.write('<tr><td><table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td bgcolor="#ffffff" onMouseOver="this.bgColor=\'#339933#\'" onMouseOut="this.bgColor=\'#ffffff\'" height="16"><a onMouseOver="displayMenu('+ctype+','+linkinfo[1]+')" onMouseOut="delayHide('+ctype+','+linkinfo[1]+')" class="' + usestyle + '" href="'+linkinfo[0]+'">&nbsp;'+labels[i]+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td><td align="right" bgcolor="#ffffff"><a onMouseOver="displayMenu('+ctype+','+linkinfo[1]+')" onMouseOut="delayHide('+ctype+','+linkinfo[1]+')" class="' + usestyle + '" href="'+linkinfo[0]+'"><img src="http://www.sripmc.org/image/subarrow.gif" width="10" height="8" border="0" hspace="0" vspace="0"></a></td></tr></table></td></tr><tr><td height="1"><img src="http://www.sripmc.org/image/verbose.gif" width="1" height="1" border="0" hspace="0" vspace="0"></td></tr>');
			}
		}
		else
		{
			document.write('<tr><td bgcolor="#ffffff" onMouseOver="this.bgColor=\'#339933#\'" onMouseOut="this.bgColor=\'#ffffff\'" height="16"><a class="' + usestyle + '" href="'+linkinfo[0]+'">&nbsp;'+labels[i]+'&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</a></td></tr><tr><td height="1"><img src="image/verbose.gif" width="1" height="1" border="0" hspace="0" vspace="0"></td></tr>');
		}
	}
	document.write('</table></td>');
	document.write('<td width="1"><img src="http://www.sripmc.org/image/verbose.gif" width="1" height="1" border="0" hspace="0" vspace="0"></td></tr>');
	document.write('</table></td></tr>');
	document.write('</table>');
	if (ie || n6) {document.writeln('</DIV>');}
	else if (n4) {document.write('</LAYER>');}
	hiddens[type][mnumber[type]] = true;
	closing[type][mnumber[type]] = 0;
	mnumber[type]++;
}

// top row
createMenu(0,31,mcenter-300,'Overview|Home&nbsp;-&nbsp;Exterior|Home&nbsp;-&nbsp;Interior|Indoor&nbsp;Plants|Public&nbsp;Health|School|Structural|Turf','http://www.sripmc.org/ipm_commodity.cfm|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=landscape%20ornamentals|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=household|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=Indoor%20Plants|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=Public%20Health|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=school%20IPM|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=structural%20pest|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=turf%20lawn');
createMenu(0,31,mcenter-215,'Overview|All&nbsp;Resources|Cotton|Soybean|Tobacco|Peanuts|Small&nbsp;Grains','http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.cottoninc.com/CottonPickin/|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=soybean|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=tobacco|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=peanut|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=small%20grain');
createMenu(0,31,mcenter-145,'Overview|Handbooks|All&nbsp;Vegetables|Allium|Beans&nbsp;and&nbsp;Peas|Brassicas|Corn|Herbs|Leafy&nbsp;Vegetables|Root&nbsp;Crops|Solanaceae|Stem&nbsp;Vegetables|Vine&nbsp;Crops','http://www.sripmc.org/commodity.cfm|http://www.sripmc.org/docs/SoutheasternVegetableGuide.pdf|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=vegetable|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=allium|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=beans%20peas|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=brassica|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=sweet%20corn|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=herbs|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=leafy|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=root|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=solanaceae|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=stem|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=vine');
createMenu(0,31,mcenter-70,'Overview|All&nbsp;Resources|Small&nbsp;Fruit|Stone&nbsp;Fruit|Apples|Pears|Brambles|Strawberries','http://www.sripmc.org/commodity.cfm|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=fruit|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=small%20fruit|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=stone%20fruit|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=apples|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=pears|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=brambles|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=strawberries');
createMenu(0,31,mcenter-13,'Overview|All&nbsp;Resources|Commercial&nbsp;Vegetables|Vegetables|Tomatoes','http://www.sripmc.org/commodity.cfm|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=greenhouse|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=commercial%20greenhouse|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=greenhouse%20vegetable|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=greenhouse%20tomato');
createMenu(0,31,mcenter+75,'Overview|All&nbsp;Resources','http://www.sripmc.org/commodity.cfm|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=ornamental');
createMenu(0,31,mcenter+170,'Overview|All&nbsp;Resources|Beef&nbsp;Cattle|Dairy&nbsp;Cattle|Poultry|Swine|Sheep','http://www.sripmc.org/commodity.cfm|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=livestock|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=beef%20cattle|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=dairy%20cattle|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=poultry|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=swine|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=sheep');
createMenu(0,31,mcenter+260,'Overview|All&nbsp;Resources|Filth&nbsp;Flies|Mosquitoes|Ticks|Roaches|Ants|Stinging&nbsp;and&nbsp;Biting','http://www.sripmc.org/commodity.cfm|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=public%20health|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=Filth%20Flies|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=mosquito|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=ticks|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=cockroach|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=ants|http://cipmtest.ent.ncsu.edu/sripmc/searchoutput.cfm?item=stinging%20biting');
// bottom row
createMenu(0,155,mcenter-285,'Overview|Center&nbsp;Personnel|Center&nbsp;Committees|Center&nbsp;Projects|Annual&nbsp;Report|Recent&nbsp;Center&nbsp;Activities','http://www.sripmc.org/SRIPMC_about.cfm|http://www.sripmc.org/SRIPMC_staff.cfm|http://www.sripmc.org/SRIPMC_committees.cfm|http://www.sripmc.org/pmcprojects/searchprojects.cfm|http://www.sripmc.org/pubs/2006_annual_report/index.cfm|http://www.sripmc.org/SRIPMC_Activities.cfm');

createMenu(0,155,mcenter-155,'Projects&nbsp;and&nbsp;Reports|Funding&nbsp;Opportunities|Crop&nbsp;Profiles/PMSPs|IPM&nbsp;Elements|Regional&nbsp;Priorities|Publications|Success&nbsp;Stories','http://www.sripmc.org/pmcprojects/searchprojects.cfm|http://www.sripmc.org/Funding.cfm|http://www.sripmc.org/rese_profiles.cfm|http://www.ipmcenters.org/ipmelements/index.cfm|http://www.sripmc.org/Policy/Priorities/|http://www.sripmc.org/publications.cfm|http://www.sripmc.org/successstory');

createMenu(0,155,mcenter-60,'Current&nbsp;Issues|Regional&nbsp;Priorities|Crop&nbsp;Profiles/PMSPs|IPM&nbsp;Elements|Publications|Other&nbsp;Data','http://www.sripmc.org/regu_current.cfm|http://www.sripmc.org/Policy/Priorities/index.cfm|http://www.sripmc.org/rese_profiles.cfm|http://www.ipmcenters.org/ipmelements/index.cfm|http://www.sripmc.org/publications.cfm|http://www.sripmc.org/regu_other.cfm');

createMenu(0,155,mcenter+59,'Auburn&nbsp;U&nbsp;(AL)|Clemson&nbsp;U&nbsp;(SC)|Louisiana&nbsp;State&nbsp;U&nbsp;(LA)|Mississippi&nbsp;State&nbsp;U&nbsp;(MS)|NCSU&nbsp;(NC)|OK&nbsp;State&nbsp;(OK)|TAMU&nbsp;(TX)|U&nbsp;Georgia&nbsp;(GA)|U&nbsp;Florida&nbsp;(FL)|University&nbsp;of&nbsp;KY(KY)|University&nbsp;of&nbsp;TN&nbsp;(TN)|Univ&nbsp;of&nbsp;PR&nbsp;(PR)|Virginia&nbsp;Tech&nbsp;(VA)',
'http://www.auburn.edu|http://www.clemson.edu|http://www.lsu.edu|http://www.msstate.edu|http://www.ncsu.edu/registrar/publications/ugc/|http://www.okstate.edu|http://www.tamu.edu|http://www.uga.edu|http://www.ufl.edu|http://www.oky.edu|http://www.utk.edu|http://www.upr.edu|http://www.vt.edu');

createMenu(0,155,mcenter+177,'Find&nbsp;an&nbsp;Expert|Funding&nbsp;Opportunities|County&nbsp;Extension&nbsp;Offices','http://www.ipmcenters.org/Experts.cfm" target="_blank|funding.cfm|http://npic.orst.edu/countyext.htm" target="_blank');

createMenu(0,155,mcenter+256,'Current&nbsp;News|Jobs&nbsp;in&nbsp;IPM|Funding&nbsp;Opportunities|Newsletters,&nbsp;Alerts&nbsp;&&nbsp;Advisories','http://www.sripmc.org/wservices/WS_getnews.cfm|http://neipmc.org/news_jobs.cfm|http://www.sripmc.org/Funding.cfm|http://www.sripmc.org/NewsAlerts/index.cfm');

// upper-right links
createMenu(0,13,mright-200,'Plant&nbsp;Diagnostic&nbsp;Network|EPA|IPM&nbsp;Centers|Stakeholders|USDA&nbsp;Agencies','http://nepdn.ppath.cornell.edu|partners_links.cfm#epa^2|partners_links.cfm#centers|partners_links.cfm#stakeholders|partners_links.cfm#usda');

// submenus
 createMenu(1,222,mcenter-144,'Overview|Community|Fruit|Greenhouse/Ornamental|Livestock|Field&nbsp;Crops|Public&nbsp;Health&nbsp;IPM|Vegetable','http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm|http://www.sripmc.org/ipm_commodity.cfm'); 

createMenu(1,205,mcenter+71,'Crops/Settings|Pest&nbsp;Data|CABI&nbsp;Compendia&nbsp;Access|Pesticide&nbsp;Use&nbsp;Data|Pesticide&nbsp;Labels|Insecticide&nbsp;Mode&nbsp;of&nbsp;Action|Pesticide&nbsp;Regulation,&nbsp;Safety,&nbsp;etc.','http://www.sripmc.org/regother_settings.cfm|http://www.sripmc.org/regother_pestdata.cfm|http://www.sripmc.org/cabi.cfm|http://www.sripmc.org/regother_pestuse.cfm|http://www.sripmc.org/regother_labels.cfm|http://www.sripmc.org/IRACMOA|http://www.sripmc.org/regother_regulation.cfm');

createMenu(1,34,mcenter+200,'National&nbsp;Office|Region&nbsp;1&nbsp;(New&nbsp;England)|Region&nbsp;2&nbsp;(NY,&nbsp;NJ,&nbsp;PR)|Region&nbsp;3&nbsp;(DE,&nbsp;MD,&nbsp;PA,&nbsp;WV,&nbsp;VA)','http://www.epa.gov|http://www.epa.gov/region1|http://www.epa.gov/region2|http://www.epa.gov/region3');

bodyloaded = true;

