
function querySt(ji) 
{
	hu = window.location.search.substring(1);
	gy = hu.split("&");
	for (i=0;i<gy.length;i++)
	 {
		ft = gy[i].split("=");
		if (ft[0] == ji)
		 {
			return ft[1];
		}
	}

}
var ButtonImagePath = "";
var koko = "";
var koko = querySt("Selected");
var menutop;
if (koko == null)
{	
	menutop = 258;
	
}else
{
	menutop = 69;
}



if (navigator.appName.indexOf("Microsoft") > -1)
{
		
}else
{
	menutop = menutop - 9;
}

var SubMenuTop =  menutop + 30;
var LastMainRol = "";

function onSub()
{
	/*if (navigator.appName.indexOf("Microsoft") > -1)
	{
		menuDisplay(getMenuByName("Milonic"), false);
		menuDisplay(getMenuByName("Markets"), false);
		menuDisplay(getMenuByName("NashuaAbout"), false);
		menuDisplay(getMenuByName("ESol"), false);
		menuDisplay(getMenuByName("News"), false);	
		if (LastMainRol == "AN")
		{
			menuDisplay(getMenuByName("NashuaAbout"), true);
		}
		if (LastMainRol == "PS")
		{
			menuDisplay(getMenuByName("Milonic"), true);
		}
		if (LastMainRol == "MK")
		{
			menuDisplay(getMenuByName("Markets"), true);
		}
		if (LastMainRol == "ES")
		{
			menuDisplay(getMenuByName("ESol"), true);
		}
		if (LastMainRol == "NW")
		{
			menuDisplay(getMenuByName("News"), true);
		}			
	}*/
	
}
function offSub()
{
	//alert(koko);
	//alert(LastMainRol);
	if (koko == "Who_we_are" || koko == "Where_we_are" || koko == "How_we_give_back")
	{
		if (LastMainRol == "AN")
		{
			menuDisplay(getMenuByName('NashuaAbout'), true);
		}
		
	}
	if (koko  ==  "WideFormat" || koko == "LabelTrans" || koko == "CoatePaper" || koko == "Resources" || koko == "EQandServ")
	{
		if (LastMainRol == "PS")
		{
			menuDisplay(getMenuByName('Milonic'), true);
		}
	}
	if (koko  ==  "Retail" || koko  ==  "Grocery" || koko == "Finacial" || koko == "DistMan" || koko == "Trans" || koko == "Repro")
	{
		if (LastMainRol == "MK")
		{
			menuDisplay(getMenuByName('Markets'), true);
		}
	}
	if (koko  ==  "OrderStatus" || koko  ==  "Ecat" || koko  ==  "OrderEntry" || koko  ==  "ESolutions")
	{
		if (LastMainRol == "ES")
		{
			menuDisplay(getMenuByName('NA'), true);
		}
	}
	/*if (koko  ==  "ESolutions")
	{
		if (LastMainRol == "ES")
		{
			menuDisplay(getMenuByName('ESol'), true);
		}
	}*/
	if (koko  ==  "News" || koko == "Events")
	{
		if (LastMainRol == "NW")
		{
			menuDisplay(getMenuByName('News'), true);
		}
	}
	
}

function onMain(myString)
{
	
		LastMainRol = myString;
		
		menuDisplay(getMenuByName("Milonic"), false);
		menuDisplay(getMenuByName("Markets"), false);
		menuDisplay(getMenuByName("NashuaAbout"), false);
		menuDisplay(getMenuByName("ESol"), false);
		menuDisplay(getMenuByName("News"), false);	
		menuDisplay(getMenuByName("NA"), false);	
		
}
function offMain()
{
	
				
	/*
	if (koko == "Who_we_are" || koko == "Where_we_are" || koko == "How_we_give_back")
	{
		menuDisplay(getMenuByName('NashuaAbout'), true);
	}
	if (koko  ==  "WideFormat" || koko == "LabelTrans" || koko == "CoatePaper" || koko == "Resources" || koko == "EQandServ")
	{
		menuDisplay(getMenuByName('Milonic'), true);
	}
	if (koko  ==  "RetailGrocery" || koko == "Finacial" || koko == "DistMan" || koko == "Trans")
	{
		menuDisplay(getMenuByName('Markets'), true);
	}
	if (koko  ==  "ESolutions")
	{
		menuDisplay(getMenuByName('ESol'), true);
	}
	if (koko  ==  "News" || koko == "Events")
	{
		menuDisplay(getMenuByName('News'), true);
	}	*/
	
}

/*
function SubClick()
{
	alert("aaaa");
	//mm_changeMenuProperty("Milonic",7,"1");	
}*/


function mm_changeMenuProperty(menuName, propertyRef, newValue) 
{ 
  var menuNum = getMenuByName(menuName); 
  _m[menuNum][propertyRef] = newValue; 
//alert(menuNum + Desc  );

  BDMenu(menuNum); 
}





fixMozillaZIndex=true; //Fixes Z-Index problem  with Mozilla browsers but causes odd scrolling problem, toggle to see if it helps
_menuCloseDelay=500;
_menuOpenDelay=150;
_subOffsetTop=20;
_subOffsetLeft=0;

with(menuStyle=new mm_style()){
bordercolor="#C82E31";
borderstyle="solid";
borderwidth=0;
fontfamily="Tw Cen MT Condensed Extra Bold";
//fontfamily="Arial";
fontsize="14pt";
fontstyle="normal";
headerbgcolor="White";
headercolor="#000000";
offbgcolor="#C82E31";
offcolor="#ffffff";
onbgcolor="#ffffff";
oncolor="#C82E31";
outfilter="randomdissolve(duration=0.3)";
//overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
padding=5;
//pagebgcolor="#82B6D7";
//pagecolor="red";
separatorcolor="#ffffff";
separatorsize=0;
//subimage="http://www.milonic.com/menuimages/arrow.gif";
subimage="";
subimagepadding=0;
//subimagepadding=2;
clickbgcolor="#ffffff";
clickcolor="#C82E31";
//onfunction="onMain()";
offfunction="offMain()";
}


with(menuStyle2=new mm_style()){
bordercolor="";
borderstyle="solid";
borderwidth=0;
fontfamily="Arial";
fontsize="10pt";
fontstyle="Bold";
headerbgcolor="White";
headercolor="#000000";
offbgcolor="#DADCE0";
offcolor="#70171f";
onbgcolor="#DADCE0";
oncolor="#C82E31";
//outfilter="randomdissolve(duration=0.3)";
//overfilter="Fade(duration=0.2);Alpha(opacity=90);Shadow(color=#777777', Direction=135, Strength=5)";
padding=10;
//pagebgcolor="#ffffff";
//pagecolor="#C82E31";
separatorcolor="#ffffff";
separatorsize=0;
subimage="http://www.milonic.com/menuimages/arrow.gif";
//subimage="";
subimagepadding=2;
clickbgcolor="#DADCEo";
clickcolor="#C82E31";
clickfunction="SubClick()";
onfunction="onSub()";
offfunction="offSub()";
}




//MAIN MENU

with(milonic=new menuname("Main Menu")){
alwaysvisible=1;
left=10;
orientation="horizontal";
style=menuStyle;
top=menutop;
}


//MAIN MENU--ABOUT NASHUA
var ButtonImagePath = "";

if (koko == null)
{
	ButtonImagePath = "";
}
else
{
	switch (koko)
	{
		case "":
		{
			ButtonImagePath = "";
			break;
		}
		case "undifined":
		{
			ButtonImagePath = "";
			
			break;
		}
		case "ESol":
		{
			ButtonImagePath = "../../";
			break;
		}	
		case "NA":
		{
			ButtonImagePath = "../../";
			break;			
		}
		default:
		{
			ButtonImagePath = "../";
		}
	}		
}





if (koko == "Who_we_are" || koko == "Where_we_are" || koko == "How_we_give_back")
{
	//show role over image
	milonic.aI("showmenu=NashuaAbout;onfunction=onMain('AN');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_01.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_ro_01.gif;url=AboutNashua.html?Selected=AboutNashua");

}else
{
	//show normal image
	milonic.aI("url=" + ButtonImagePath + "AboutNashua/AboutNashua.html?Selected=AboutNashua;showmenu=NashuaAbout;onfunction=onMain('AN');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_01.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_01.gif;");
} 


//MAIN MENU--Product And Services

if (koko  ==  "WideFormat" || koko == "LabelTrans" || koko == "CoatePaper" || koko == "Resources" || koko == "EQandServ")
{
	milonic.aI("showmenu=Milonic;onfunction=onMain('PS');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_02.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_ro_02.gif;");	
}else
{	
	milonic.aI("showmenu=Milonic;onfunction=onMain('PS');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_02.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_02.gif;");	
}



//MAIN MENU--Markets
if (koko  ==  "Grocery" || koko  ==  "Retail" || koko == "Finacial" || koko == "DistMan" || koko == "Trans" || koko == "Repro")
{
	milonic.aI("showmenu=Markets;onfunction=onMain('MK');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_03.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_ro_03.gif;");	
}else
{	
	milonic.aI("showmenu=Markets;onfunction=onMain('MK');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_03.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_03.gif;");	
}


//MAIN MENU--ESolutions
/*
if (koko  ==  "ESolutions")
{
	milonic.aI("showmenu=ESol;onfunction=onMain('ES');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_04.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_ro_04.gif;");	
}else
{	
	milonic.aI("showmenu=ESol;onfunction=onMain('ES');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_04.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_04.gif;");	
}
*/

if (koko  ==  "OrderStatus" || koko  ==  "Ecat" || koko  ==  "OrderEntry" || koko  ==  "ESolutions")
{
	milonic.aI("showmenu=NA;onfunction=onMain('ES');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_04.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_ro_04.gif;");	
}

else
{	
	milonic.aI("showmenu=NA;onfunction=onMain('ES');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_04.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_04.gif;");	
}




//MAIN MENU--News And Events
if (koko  ==  "News" || koko == "Events")
{
	milonic.aI("showmenu=News;onfunction=onMain('NW');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_05.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_ro_05.gif;");	
}else
{	
	milonic.aI("showmenu=News;onfunction=onMain('NW');overimage=" + ButtonImagePath + "Menu/buttons/mainnav_ro_05.gif;image=" + ButtonImagePath + "Menu/buttons/mainnav_05.gif;");	
}




//SUB MENUS

with(milonic=new menuname("NashuaAbout")){
left=10;
top=SubMenuTop;
orientation="horizontal";
style=menuStyle2;
}
var myPath = "";
if (koko  ==  "Who_we_are" || koko == "Where_we_are" || koko == "How_we_give_back")
{
	milonic.alwaysvisible=1;
	myPath = "";	
}else
{
	milonic.alwaysvisible=0;
	if (koko == "" || koko == null)
	{
		myPath = "../AboutNashua/";		
	}else
	{
		myPath = "../AboutNashua/";	
		if (koko == "ESol" )
		{
			myPath  = "../" + myPath;
		}
	}
}



if (koko == "Who_we_are")
{	
	milonic.aI("align=center;text=Who we are;url=" + myPath + "WhoWeAre.html?Selected=Who_we_are;offcolor=#C82E31;");
}else
{
	milonic.aI("align=center;text=Who we are;url=" + myPath + "WhoWeAre.html?Selected=Who_we_are;");
}
if (koko == "Where_we_are")
{	
	milonic.aI("align=center;text=Where we are;url=" + myPath + "WhereWeAre.html?Selected=Where_we_are;offcolor=#C82E31;");
}else
{
	milonic.aI("align=center;text=Where we are;url=" + myPath + "WhereWeAre.html?Selected=Where_we_are;offcolor=#70171f;");
}
if (koko == "How_we_give_back")
{	
	milonic.aI("align=center;text=How we give back;url=" + myPath + "HowWeGiveBack.html?Selected=How_we_give_back;offcolor=#C82E31;");
}else
{
	milonic.aI("align=center;text=How we give back;url=" + myPath + "HowWeGiveBack.html?Selected=How_we_give_back;offcolor=#70171f;");
}



with(milonic1=new menuname("Milonic")){
left=10;
top=SubMenuTop;
orientation="horizontal";
style=menuStyle2;
}

if (koko  ==  "WideFormat" || koko == "LabelTrans" || koko == "CoatePaper" || koko == "EQandServ")
{
	milonic1.alwaysvisible=1;
	myPath = "";
}else
{
	milonic1.alwaysvisible=0;
	if (koko == "" || koko == null)
	{
		myPath = "../ProdAndServices/";
	}else
	{
		myPath = "../ProdAndServices/";
		if (koko == "ESol" )
		{
			myPath  = "../" + myPath;
		}
	}
	
		
}

if (koko == "WideFormat")
{	
	//////////////milonic1.aI("align=center;text=Wide Format;url=http://www.dietzgen.com;target=_blank");
	//milonic1.aI("align=center;text=Wide Format;url=" + myPath + "WideFormat.aspx?Selected=WideFormat;offcolor=#C82E31;");
}else
{
	////////////////milonic1.aI("align=center;text=Wide Format;url=http://www.dietzgen.com;target=_blank");
	//milonic1.aI("align=center;text=Wide Format;url=" + myPath + "WideFormat.aspx?Selected=WideFormat;offcolor=#70171f;");
}

if (koko == "LabelTrans")
{
	milonic1.aI("align=center;text=Label, Print & Transaction;url=" + myPath + "PrintAndTrans.aspx?Selected=LabelTrans;offcolor=#C82E31;");
}else
{
	milonic1.aI("align=center;text=Label, Print & Transaction;url=" + myPath + "PrintAndTrans.aspx?Selected=LabelTrans;offcolor=#70171f");
}

if (koko == "CoatePaper")
{
	milonic1.aI("align=center;text=Coated Products;url=" + myPath + "CoatedProducts.aspx?Selected=CoatePaper;offcolor=#C82E31;");
}else
{
	milonic1.aI("align=center;text=Coated Products;url=" + myPath + "CoatedProducts.aspx?Selected=CoatePaper;offcolor=#70171f");
}

if (koko == "EQandServ")
{
	milonic1.aI("align=center;text=Equipment & Services;url=" + myPath + "EquipServices.aspx?Selected=EQandServ;offcolor=#C82E31;");
}else
{
	milonic1.aI("align=center;text=Equipment & Services;url=" + myPath + "EquipServices.aspx?Selected=EQandServ;offcolor=#70171f");
}





with(milonic2=new menuname("Markets")){
left=130;
top=SubMenuTop;
orientation="horizontal";
style=menuStyle2;
}

if (koko  ==  "Retail" || koko == "Grocery" || koko == "Finacial" || koko == "DistMan" || koko == "Trans" || koko == "Repro")
{
	milonic2.alwaysvisible=1;
	myPath = "";
}else
{
	milonic2.alwaysvisible=0;
	if (koko == "" || koko == null)
	{
		myPath = "../Markets/";
	}else
	{
		myPath = "../Markets/";
		if (koko == "ESol")
		{
			myPath  = "../" + myPath;
		}
	}
}


if (koko == "Retail")
{
	milonic2.aI("align=center;text=Retail;url=" + myPath + "Retail.aspx?Selected=Retail;offcolor=#C82E31;");
}else
{
	milonic2.aI("align=center;text=Retail;url=" + myPath + "Retail.aspx?Selected=Retail;offcolor=#70171f");
}

if (koko == "Grocery")
{
	milonic2.aI("align=center;text=Grocery;url=" + myPath + "Grocery.aspx?Selected=Grocery;offcolor=#C82E31;");
}else
{
	milonic2.aI("align=center;text=Grocery;url=" + myPath + "Grocery.aspx?Selected=Grocery;offcolor=#70171f");
}


if (koko == "Finacial")
{
	milonic2.aI("align=center;text=Financial;url=" + myPath + "Financial.aspx?Selected=Finacial;offcolor=#C82E31;");
}else
{
	milonic2.aI("align=center;text=Financial;url=" + myPath + "Financial.aspx?Selected=Finacial;offcolor=#70171f");
}

if (koko == "DistMan")
{
	milonic2.aI("align=center;text=Distribution/Manufacturing;url=" + myPath + "Warehouse.aspx?Selected=DistMan;offcolor=#C82E31;");
}else
{
	milonic2.aI("align=center;text=Distribution/Manufacturing;url=" + myPath + "Warehouse.aspx?Selected=DistMan;offcolor=#70171f");
}
if (koko == "Trans")
{
	milonic2.aI("align=center;text=Transportation;url=" + myPath + "Transport.aspx?Selected=Trans;offcolor=#C82E31;");
}else
{
	milonic2.aI("align=center;text=Transportation;url=" + myPath + "Transport.aspx?Selected=Trans;offcolor=#70171f");
}
if (koko == "Repro")
{
	///////////milonic2.aI("align=center;text=Reprographics;url=" + myPath + "Repro.aspx?Selected=Repro;offcolor=#C82E31;");
}else
{
	///////////milonic2.aI("align=center;text=Reprographics;url=" + myPath + "Repro.aspx?Selected=Repro;offcolor=#70171f");
}



/*if (koko  ==  "OrderStatus" || koko  ==  "Ecat" || koko  ==  "OrderEntry")
{*/
		with(milonic3=new menuname("NA")){
			left=343;
			top=SubMenuTop;
			orientation="horizontal";
			style=menuStyle2;
			}
			
			if (koko  ==  "OrderStatus" || koko  ==  "Ecat" || koko  ==  "OrderEntry")
			{
				milonic3.alwaysvisible=1;
				myPath = "../ESol/";
			}else
			{
				myPath = "../ESol/";
				milonic3.alwaysvisible=0;
				if (koko == "" || koko == null)
				{
					//myPath = "../NashuaDev/ESol/";
					myPath = "../ESol/";
				}else
				{
					myPath = "../ESol/";
					if (koko == "ESol")
					{
						myPath  = "../" + myPath;
					}
				}
			}
			
			if (koko == "OrderStatus")
			{
				milonic3.aI("align=center;text=Order Status;url=" + myPath + "ordersearch.aspx?Selected=OrderStatus;offcolor=#C82E31;");
			}else
			{
				milonic3.aI("align=center;text=Order Status;url=" + myPath + "ordersearch.aspx?Selected=OrderStatus;offcolor=#70171f;");
			}
			
			if (koko == "Ecat")
			{
				milonic3.aI("align=center;text=e-Catalog;url=" + myPath + "AdvantageHome.aspx?Selected=Ecat;offcolor=#C82E31;");
			}else
			{
				milonic3.aI("align=center;text=e-Catalog;url=" + myPath + "AdvantageHome.aspx?Selected=Ecat;offcolor=#70171f;");
			}	
			
			if (koko == "OrderEntry")
			{
				milonic3.aI("align=center;text=Online Ordering;url=" + myPath + "AdvantageHome.aspx?Selected=OrderEntry;offcolor=#C82E31;");
			}else
			{
				milonic3.aI("align=center;text=Online Ordering;url=" + myPath + "AdvantageHome.aspx?Selected=OrderEntry;offcolor=#70171f;");
			}	
	
/*	
	
}else
{
	with(milonic3=new menuname("ESol")){
			left=343;
			top=SubMenuTop;
			orientation="horizontal";
			style=menuStyle2;
			}
			
			if (koko  ==  "ESolutions")
			{
				milonic3.alwaysvisible=1;
			}else
			{
				milonic3.alwaysvisible=0;
				if (koko == "" || koko == null)
				{
					myPath = "../ESol/";
				}else
				{
					myPath = "../ESol/";
					if (koko == "ESol")
					{
						myPath  = "../" + myPath;
					}
				}
			}
			
			if (koko == "ESolutions")
			{
				
				milonic3.aI("align=center;text=e-Solutions home page;url=http://esolutions.nashua.com;offcolor=#C82E31;;target=_blank");
			}else
			{
				
				milonic3.aI("align=center;text=e-Solutions home page;url=http://esolutions.nashua.com;offcolor=#70171f;target=_blank");
			}	
}*/


with(milonic4=new menuname("News")){
left=482;
top=SubMenuTop;
orientation="horizontal";
style=menuStyle2;
}

if (koko  ==  "News" || koko == "Events")
{
	milonic4.alwaysvisible=1;
	myPath = "";
}else
{
	milonic4.alwaysvisible=0;
	if (koko == "" || koko == null)
	{
		myPath = "../NewsEvents/";
	}else
	{
		myPath = "../NewsEvents/";
		if (koko == "ESol")
		{
			myPath  = "../" + myPath;
		}
	}
}

if (koko == "News")
{
	milonic4.aI("align=center;text=News;url=" + myPath + "News.aspx?Selected=News;offcolor=#C82E31;");
}else
{
	milonic4.aI("align=center;text=News;url=" + myPath + "News.aspx?Selected=News;offcolor=#70171f");
}
if (koko == "Events")
{
	milonic4.aI("align=center;text=Events;url=" + myPath + "Events.aspx?Selected=Events;offcolor=#C82E31;");
}else
{
	milonic4.aI("align=center;text=Events;url=" + myPath + "Events.aspx?Selected=Events;offcolor=#70171f");
}



drawMenus();

function HomeLink()
{
	var x = get_cookie ( "Site" );
	if (x == "RSPA")
	{
		window.location="http://www.nashua.com/RSPA.html";	
	}else
	{
		window.location="http://www.nashua.com/Index.html";
	}
	
}
function get_cookie ( cookie_name )
{
  var results = document.cookie.match ( '(^|;) ?' + cookie_name + '=([^;]*)(;|$)' );

  if ( results )
    return ( unescape ( results[2] ) );
  else
    return null;
}



function toggleDiv(divid,toggleTo){
    if(document.getElementById(divid).style.display == 'none')
    {
      document.getElementById(divid).style.display = 'block';
    }else
    {
      document.getElementById(divid).style.display = 'none';
    }
  }




