var Menu = new Array ();
var subMenu = new Array ();
Menu[0] = new Array("COMPANY", "","_top");
subMenu[0] = new Array();       
subMenu[0][0] = new Array ("Home", "/","_top");
subMenu[0][1] = new Array ("Management", "mgt.html","_top");
subMenu[0][2] = new Array ("Board of Directors", "board.html","_top");
subMenu[0][3] = new Array ("Mission / Vision Statement", "visionmission.html","_top");
subMenu[0][4] = new Array ("Sustainability Statement", "sustainability.html","_top");
subMenu[0][5] = new Array ("Corporate &amp; Manufacturing Locations", "locations.html","_top");
subMenu[0][6] = new Array ("Directions", "directions.html","_top");
subMenu[0][7] = new Array ("Employees", "employees.html","_top");
subMenu[0][8] = new Array ("Investor Contact", "investor.html","_top");

Menu[1] = new Array("PRODUCTS", "","_top"); 
subMenu[1] = new Array();
subMenu[1][0] = new Array ("COLOR UV Coatings", "colorcoat.html","_top","UVColorCoatings.jpg");
subMenu[1][1] = new Array ("CLEAR UV Coatings", "clearcoat.html","_top","UVClearCoatings.jpg");
subMenu[1][2] = new Array ("Dielectrics &amp; Encapsulants", "dielectricencapsulant.html","_top","DieEncap.jpg");
subMenu[1][3] = new Array ("Silver &amp; Nano<br>Conductive Inks", "silvernano.html","_top","silvernanohome.jpg");
subMenu[1][4] = new Array ("Sustainable Lighting E-L's", "sustainablelighting.html","_top","lighting.gif");
subMenu[1][5] = new Array ("Allied PhotoPolymers", "alliedphotopolymers.html","_top","AlliedPhotoPolymers.jpg");
subMenu[1][6] = new Array ("Custom Formulations", "customrequest.html","_top","CustomForm.jpg");
   
Menu[2] = new Array("TECHNOLOGY", "","_top");
subMenu[2] = new Array();
subMenu[2][0] = new Array("Video Applications", "videoapps.html","_top");
subMenu[2][1] = new Array("White Papers", "whitepapers.html","_top");
subMenu[2][2] = new Array("How UV Works", "howUVworks.html","_top");
subMenu[2][3] = new Array("Cure Time", "curingTime.html","_top");// - UV V's Powder/2K
subMenu[2][4] = new Array("100% Solids Vs Hybrids", "100percent.html","_top");
subMenu[2][5] = new Array("Nordson UV Spectrum", "uvspectrumnordson.html","_top");
subMenu[2][6] = new Array("Fusion UV Bulb Spectrum", "uvspectrum.html","_top");
subMenu[2][7] = new Array("Electromagnetic Spectrum", "electrospectrum.html","_top");
subMenu[2][8] = new Array("Industry Associations", "associations.html","_top");

Menu[3] = new Array("ECONOMICS", "","_top"); 
subMenu[3] = new Array();
subMenu[3][0] = new Array("ROI - Return on Investment", "roiecalc.html","_top");
subMenu[3][1] = new Array("Metal Container Case Study", "caseStudy1.html","_top");
subMenu[3][2] = new Array("Flat Composite Case Study", "caseStudy2.html","_top");
subMenu[3][3] = new Array("Simple ROI Financial Model", "simpleRoi.html","_top");     
subMenu[3][4] = new Array("Detailed ROI Financial Model", "detailedRoi.html","_top");
subMenu[3][5] = new Array("Watch ROI Video", "alliedvideo.html","_top");

/*
subMenu[3][1] = new Array("Starter Kit", "starterkit.html","_top");
subMenu[3][2] = new Array("Economics of Implementing UV Checklist", "econuvchklist.html","_top");
subMenu[3][3] = new Array("Best in Class Component Suppliers", "componentsuppliers.html","_top");     
subMenu[3][4] = new Array("Best in Class Integrators", "integrators.html","_top");
subMenu[3][5] = new Array("Best in Class UV Consultants", "consultants.html","_top");
*/

Menu[4] = new Array("SUSTAINABLE UV", "","_top");
subMenu[4] = new Array();
subMenu[4][0] = new Array ("Sustainabe UV Statement", "sustainableUV.html","_top");
subMenu[4][1] = new Array("Sustainable Webinar", "webinar.html","_top");

/*
subMenu[4][0] = new Array("White Papers", "whitepapers.html","_top");
subMenu[4][1] = new Array("Case Studies", "casestudies.html","_top");
subMenu[4][2] = new Array("ROIe - Financial Calculator", "roiecalc.html","_top");
*/

Menu[5] = new Array("MARKETS", "","_top");
subMenu[5] = new Array(); 	 
subMenu[5][0] = new Array("Market Case Studies", "casestudies.html", "_top");	
subMenu[5][1] = new Array("Specific Market Articles", "marketArticles.html", "_top");

Menu[6] = new Array("NEWS &amp; EVENTS", "","_top");
subMenu[6] = new Array(); 	 
subMenu[6][0] = new Array("News / Events", "news.html", "_top");	
subMenu[6][1] = new Array("Industry Awards", "awards.html", "_top");

Menu[7] = new Array("CONTACT", "","_top");
subMenu[7] = new Array(); 	 
subMenu[7][0] = new Array("Contact Allied", "contact.html", "_top");	

function getCategory(pageName){
  var navs = new Array();
  if(pageName == '/v5' || pageName == '/'){
    navs[0] = 0;
    navs[1] = 0;
    return navs;
  }

  if(pageName == 'absresins.html' || pageName == 'quickcastresins.html' || pageName == 'pigmentedresins.html' || pageName == 'custompolymer.html' ){
    navs[0] = 1;
    navs[1] = 5;
    return navs;
  }

  if(pageName == 'video1.html' || pageName == 'curing.html' || pageName == 'fullycured.html' ){
    navs[0] = 2;
    navs[1] = 1000;
    return navs;
  }

  if(pageName == 'conduit.html' || pageName == 'drumSticks.html' || pageName == 'Aluminum.html'  || pageName == 'material.html'  || pageName == 'propane.html'  || pageName == 'brake.html'  || pageName == 'pulley.html'  || pageName == 'stabilization.html'  || pageName == 'cylinder.html'  || pageName == 'metal.html'  ){
    navs[0] = 1;
    navs[1] = 0;
    return navs;
  }
  if(pageName == 'pvd.html' || pageName == 'ceramicTile.html' || pageName == 'steel.html' || pageName == 'concrete.html' || pageName == 'pvd2.html' || pageName == 'plastic.html' || pageName == 'piping.html' || pageName == 'clearonAluminum.html' || pageName == 'polycarbonate.html' || pageName == 'wood.html' ){
    navs[0] = 1;
    navs[1] = 1;
    return navs;
  }


  for (x=0; x<Menu.length; x++){
    if(pageName == Menu[x][1]){
      navs[0] = x;
      navs[1] = 0;
      return navs;
    }
    for (y=0; y<subMenu[x].length; y++){
      navs[0] = x;
      navs[1] = y;
      if(pageName == subMenu[x][y][1]){
	navs[0] = x;
	navs[1] = y;
	return navs;
      }
    }
  }
  navs[0] = 0;
  navs[1] = 1000;
  return navs;
}
function getPageName(urlArray){
  var pageName = urlArray[urlArray.length - 1];
  if(pageName == '/'){
    pageName = 'index.html';
  }
  if(pageName == 'absresins.html' || pageName == 'quickcastresins.html' || pageName == 'pigmentedresins.html' || pageName == 'custompolymer.html' ){
    // pageName='alliedphotopolymers.html';
  }
  if(pageName == 'conduit.html' ){
    //pageName='colorcoat.html';
  }
  if(pageName == 'contact.cgi' ){
    pageName='contact.html';
  }
  if(pageName == 'custom.cgi' || pageName == 'custom.html'  ){
    pageName='customrequest.html';
  }
  if(pageName == 'custompolymer.cgi' || pageName == 'custompolymer.html' ){
    pageName='custompolymer.html';
  }
  return pageName;
}
function doProducts(){
  var urlArray = location.pathname.split("\/");
  var pageName = getPageName(urlArray);
  for (x=0; x<subMenu[1].length; x++){
    if(pageName == subMenu[1][x][1]){
      if(subMenu[1][x][1] == 'colorcoat.html'){
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a href="colorcoat.html" class="leftstyle9subnavchosen" onmouseover="mopen(\'colorcoat\')"  onmouseout="mclosetime()">' + subMenu[1][x][0] + '</a><div id="colorcoat"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" ><a href="conduit.html">Conduit</a><a href="drumSticks.html">Drum Sticks</a><a href="Aluminum.html">Aluminum</a><a href="material.html">Strapping Material</a><a href="propane.html">Propane Tanks</a><a href="brake.html">Brake</a><a href="pulley.html">Automotive Pulley</a><a href="stabilization.html">Stabilization Bar</a><a href="cylinder.html">Cylinder</a><a href="metal.html">Machined Metal</a></div></td></tr>');
      }else if(subMenu[1][x][1] == 'clearcoat.html'){
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a href="clearcoat.html" class="leftstyle9subnavchosen" onmouseover="mopen(\'clearcoat\')"  onmouseout="mclosetime()">' + subMenu[1][x][0] + '</a><div id="clearcoat"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" ><a href="pvd.html">PVD Metal</a><a href="ceramicTile.html">Ceramic Tile</a><a href="steel.html">Steel</a><a href="concrete.html">Concrete</a><a href="pvd2.html">PVD Plastics</a><a href="plastic.html">Plastic Substrate</a><a href="piping.html">Piping</a><a href="clearonAluminum.html">Aluminum</a><a href="polycarbonate.html">Polycarbonate</a><a href="wood.html">Wood</a></div></td></tr>');
      }else if(subMenu[1][x][1] == 'alliedphotopolymers.html'){
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a href="alliedphotopolymers.html" class="leftstyle9subnavchosen" onmouseover="mopen(\'alliedphotopolymers\')"  onmouseout="mclosetime()">' + subMenu[1][x][0] + '</a><div id="alliedphotopolymers"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" ><a href="absresins.html">ABS Resin</a><a href="quickcastresins.html">QuickCast Resin</a><a href="pigmentedresins.html">Pigmented Resin</a><a href="custompolymer.html">Formulations Requests/Feedback</a></div></td></tr>');
      }else{
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><span class="leftstyle9">' + subMenu[1][x][0] + '</span></td></tr>');
      }
    }else{
      if(subMenu[1][x][1] == 'colorcoat.html'){
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a href="colorcoat.html" class="leftstyle9subnav" onmouseover="mopen(\'colorcoat\')"  onmouseout="mclosetime()">' + subMenu[1][x][0] + '</a><div id="colorcoat"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" ><a href="conduit.html">Conduit</a><a href="drumSticks.html">Drum Sticks</a><a href="Aluminum.html">Aluminum</a><a href="material.html">Strapping Material</a><a href="propane.html">Propane Tanks</a><a href="brake.html">Brake</a><a href="pulley.html">Automotive Pulley</a><a href="stabilization.html">Stabilization Bar</a><a href="cylinder.html">Cylinder</a><a href="metal.html">Machined Metal</a></div></td></tr>');
      }else if(subMenu[1][x][1] == 'clearcoat.html'){
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a href="clearcoat.html" class="leftstyle9subnav" onmouseover="mopen(\'clearcoat\')"  onmouseout="mclosetime()">' + subMenu[1][x][0] + '</a><div id="clearcoat"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" ><a href="pvd.html">PVD Metal</a><a href="ceramicTile.html">Ceramic Tile</a><a href="steel.html">Steel</a><a href="concrete.html">Concrete</a><a href="pvd2.html">PVD Plastics</a><a href="plastic.html">Plastic Substrate</a><a href="piping.html">Piping</a><a href="clearonAluminum.html">Aluminum</a><a href="polycarbonate.html">Polycarbonate</a><a href="wood.html">Wood</a></div></td></tr>');
      }else if(subMenu[1][x][1] == 'alliedphotopolymers.html'){
	document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a href="alliedphotopolymers.html" class="leftstyle9subnav" onmouseover="mopen(\'alliedphotopolymers\')"  onmouseout="mclosetime()">' + subMenu[1][x][0] + '</a><div id="alliedphotopolymers"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" ><a href="absresins.html">ABS Resin</a><a href="quickcastresins.html">QuickCast Resin</a><a href="pigmentedresins.html">Pigmented Resin</a><a href="custompolymer.html">Formulations Requests/Feedback</a></div></td></tr>');
      }else{
      document.writeln('<tr bgcolor="#FFFFFF"><td width="60" align="center" valign="middle"><img src="images/' + subMenu[1][x][3] + '" width="60" height="60"></td><td width="164"><a class="leftstyle9" href="' + subMenu[1][x][1] + '">' + subMenu[1][x][0] + '</a></td></tr>');
      }
    }
  }
}

function doNav() {
  var urlArray = location.pathname.split("\/");
  var pageName = getPageName(urlArray);
  var navInfo = getCategory(pageName);
  var cat = navInfo[0];
  var subcat = navInfo[1];
  var navCells = '';
  var subNav = subcat == 0 ? '<span class="style9">' + subMenu[cat][0][0] + '</span>' : '<a href="' + subMenu[cat][0][1] + '">' + subMenu[cat][0][0] + '</a>';
  for (y=1; y<subMenu[cat].length; y++){
    var navname = subMenu[cat][y][0];
    if(subMenu[cat][y][0] == 'Nordson UV Spectrum'){
      navname = 'Nordson UV';
    }
    if(subMenu[cat][y][0] == 'Fusion UV Bulb Spectrum'){
      navname = 'Fusion UV';
    }
    if(subMenu[cat][y][0] == 'Silver &amp; Nano<br>Conductive Inks'){
      navname = 'Silver &amp; Nano Conductive Inks';
    }
    var linkName = subcat == y ? '<span class="style9">' + navname + '</span>' : '<a href="' + subMenu[cat][y][1] + '">' + navname + '</a>';
    subNav += ' | ' + linkName;
  }
  for (x=0; x<Menu.length; x++){
    var dropdowns ='';
    for (y=0; y<subMenu[x].length; y++){
      dropdowns += '<a href="' + subMenu[x][y][1] + '">' + subMenu[x][y][0] + '</a>';
    }
    var banner_gif = x == cat ? 'banner2.gif' : 'banner.gif';
    var thing = '<a onmouseover="mopen(\'m'+ x + '\')"  onmouseout="mclosetime()">' + Menu[x][0] + '</a> <div id="m' + x + '"  onmouseover="mcancelclosetime()"  onmouseout="mclosetime()" >'+ dropdowns + '</div>';
    
    navCells += '<td height="26" background="images/' + banner_gif + '" class="intro"><div align="center">' + thing + '</div></td>';
  }
  document.writeln ('<table id="navBar" width="900" height="52" border="0" cellpadding="0" cellspacing="0" ><tr>' + navCells + '</tr><tr><td colspan="8" bgcolor="#EBF6E3" class="address"><table width="100%" border="0" cellspacing="0" cellpadding="8"><tr><td class="subcategory">' + subNav + '</td></tr></table></td>  </tr></table>');
  //<tr><td class="subsubcategory">' + subNav + '</td></tr> 
}

// Copyright 2006-2007 javascript-array.com

var timeout	= 500;
var closetimer	= 0;
var ddmenuitem	= 0;

// open hidden layer
function mopen(id)
{	
	// cancel close timer
	mcancelclosetime();

	// close old layer
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';

	// get new layer and show it
	ddmenuitem = document.getElementById(id);
	ddmenuitem.style.visibility = 'visible';

}
// close showed layer
function mclose()
{
	if(ddmenuitem) ddmenuitem.style.visibility = 'hidden';
}

// go close timer
function mclosetime()
{
	closetimer = window.setTimeout(mclose, timeout);
}

// cancel close timer
function mcancelclosetime()
{
	if(closetimer)
	{
		window.clearTimeout(closetimer);
		closetimer = null;
	}
}

// close layer when click-out
document.onclick = mclose; 



//added this but it is obsolete
function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_CheckFlashVersion(reqVerStr,msg){
  with(navigator){
    var isIE  = (appVersion.indexOf("MSIE") != -1 && userAgent.indexOf("Opera") == -1);
    var isWin = (appVersion.toLowerCase().indexOf("win") != -1);
    if (!isIE || !isWin){  
      var flashVer = -1;
      if (plugins && plugins.length > 0){
        var desc = plugins["Shockwave Flash"] ? plugins["Shockwave Flash"].description : "";
        desc = plugins["Shockwave Flash 2.0"] ? plugins["Shockwave Flash 2.0"].description : desc;
        if (desc == "") flashVer = -1;
        else{
          var descArr = desc.split(" ");
          var tempArrMajor = descArr[2].split(".");
          var verMajor = tempArrMajor[0];
          var tempArrMinor = (descArr[3] != "") ? descArr[3].split("r") : descArr[4].split("r");
          var verMinor = (tempArrMinor[1] > 0) ? tempArrMinor[1] : 0;
          flashVer =  parseFloat(verMajor + "." + verMinor);
        }
      }
      // WebTV has Flash Player 4 or lower -- too low for video
      else if (userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 4.0;

      var verArr = reqVerStr.split(",");
      var reqVer = parseFloat(verArr[0] + "." + verArr[2]);
  
      if (flashVer < reqVer){
        if (confirm(msg))
          window.location = "http://www.macromedia.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash";
      }
    }
  } 
}



//
  function doPDF(pdflink){
  if(!(hasCookie('PDF'))){
  onClick=Popup=window.open("pdfform.cgi?pdf=" + pdflink,'Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes, width=450,height=550,left=50,top=50');
  return false;
  }else{
  onClick=Popup=window.open('http://www.alliedphotochemical.com/' + pdflink,'Popup','toolbar=no,location=no,status=no,menubar=no,scrollbars=yes,resizable=yes, width=450,height=550,left=50,top=50');
  return false;
  }
  }

		function hasCookie( check_name ) {
	// first we'll split this cookie up into name/value pairs
	// note: document.cookie only returns name=value, not the other components
	var a_all_cookies = document.cookie.split( ';' );
	var a_temp_cookie = '';
	var cookie_name = '';
	var cookie_value = '';
	var b_cookie_found = false; // set boolean t/f default f

	for ( i = 0; i < a_all_cookies.length; i++ )
	{
		// now we'll split apart each name=value pair
		a_temp_cookie = a_all_cookies[i].split( '=' );


		// and trim left/right whitespace while we're at it
		cookie_name = a_temp_cookie[0].replace(/^\s+|\s+$/g, '');

		// if the extracted name matches passed check_name
		if ( cookie_name == check_name )
		{
			b_cookie_found = true;
			// we need to handle case where cookie has no value but exists (no = sign, that is):
			if ( a_temp_cookie.length > 1 )
			{
				cookie_value = unescape( a_temp_cookie[1].replace(/^\s+|\s+$/g, '') );
			}
			// note that in cases where cookie is initialized but no value, null is returned
			return true;
			break;
		}
		a_temp_cookie = null;
		cookie_name = '';
	}
	if ( !b_cookie_found )
	{
		return false;
	}
}

    function load() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
      }
    }

    function initialize() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(42.95, -82.47), 11);
        map.addControl(new GSmallMapControl());
        map.addControl(new GMapTypeControl());
	var latlng = new GLatLng(42.905440, -82.523117);
	map.addOverlay(new GMarker(latlng));
	//latlng = new GLatLng(42.992178,-82.427716);
	//map.addOverlay(new GMarker(latlng));
	//map.openInfoWindow(new GLatLng(42.905440, -82.523117),document.createTextNode("Hello, world"));

      }
    }

    function initialize1() {
      if (GBrowserIsCompatible()) {
        var map = new GMap2(document.getElementById("map_canvas"));
        map.setCenter(new GLatLng(37.4419, -122.1419), 13);
        map.openInfoWindow(map.getCenter(),
                           document.createTextNode("Allied"));
      }
    }




