
if (document.images) {

  image1on = new Image();
  image1on.src = "/images/nav_attorneysX.gif";
  image1off = new Image();
  image1off.src = "/images/nav_attorneys.gif";
  
  image2on = new Image();
  image2on.src = "/images/nav_asbestosX.gif";
  image2off = new Image();
  image2off.src = "/images/nav_asbestos.gif";
  
  image3on = new Image();
  image3on.src = "/images/nav_practiceX.gif";
  image3off = new Image();
  image3off.src = "/images/nav_practice.gif";
  
  image4on = new Image();
  image4on.src = "/images/nav_resourcesX.gif";
  image4off = new Image();
  image4off.src = "/images/nav_resources.gif";
  
  image5on = new Image();
  image5on.src = "/images/nav_contactX.gif";
  image5off = new Image();
  image5off.src = "/images/nav_contact.gif";
  
  }

function changeImages() {
  if (document.images) {
    for (var i=0; i<changeImages.arguments.length; i+=2) {
      document[changeImages.arguments[i]].src = eval(changeImages.arguments[i+1] + ".src");
    }
  }
}

function openwin(theURL,winName,features) 
    {
      window.open(theURL,winName,features);
    }
		



	// ------------------- Menu Text ----------------//
	overColor = "#66B2E2"
	function changeBGColor(element){
		element.style.background = overColor;
		element.style.cursor = "hand";
	}
	function restoreBGColor(element){
		element.style.background = "#efefef";
		element.style.cursor = "";
	}

	browserName = navigator.appName;
	browserVer = parseInt(navigator.appVersion);
	if ((browserVer >= 4)|| (browserName == "Netscape" && browserVer >= 3))
	   version = "enabled";
	else
	   version = "disabled";
	
	LoadDone = "No";
	
	NS4 = (document.layers);
	IE4 = (document.all);

	NS6 = (document.getElementById && !IE4);
	V4 =  (NS4 || IE4 || NS6);
	GlobalLayer = "xx";
	TimerID = 0;

	// ------------------- Menu Text ----------------//
	overColor = "#D2D0D8"
	function changeMenuBGColor(element){
		element.style.background = overColor;
		element.style.cursor = "hand";
	}
	function restoreMenuBGColor(element){
		element.style.background = "#efefef";
		element.style.cursor = "";
	}
	
	function makeLink(targetHref,labelText){
		if(NS4){
			return '<a class="navmenu" href="' + targetHref + '">' + labelText + '</a>';
		}else{
			return labelText;
		}
	}

	notNetscape = "";
var menu1Text = '<TABLE class="dropdown" onMouseOver="changeImages(\'image1\', \'image1on\');" onMouseOut="changeImages(\'image1\', \'image1off\');" cellpadding="1" cellspacing="0" border="0" bgcolor="black"><TR><TD><TABLE bgcolor="#FFFFFF" cellpadding="1" cellspacing="0" border="0"><TR><TD>' +
	'			<table width="100%" cellpadding="2" cellspacing="0" border="0">' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="1" border="0" alt=""></td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/attorneys/hobin_r.cfm\'">' + makeLink('/attorneys/','Richard Hobin') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/attorneys/shingler_r.cfm\'">' + makeLink('/attorneys/shingler_r.cfm','Ronald J. Shingler') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/attorneys/simon_a.cfm\'">' + makeLink('/attorneys/simon_a.cfm','Aaron H. Simon') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/attorneys/staff.cfm\'">' + makeLink('/attorneys/staff.cfm','Our Staff') + '</td></tr>' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="2" border="0" alt=""></td></tr>' +
	'			</table>' +
	'	</td></tr></TABLE>' +
	'</TD></TR></TABLE>';

	var menu2Text = '<TABLE class="dropdown" onMouseOver="changeImages(\'image2\', \'image2on\');" onMouseOut="changeImages(\'image2\', \'image2off\');" cellpadding="1" cellspacing="0" border="0" bgcolor="black"><TR><TD><TABLE bgcolor="#FFFFFF" cellpadding="1" cellspacing="0" border="0"><TR><TD>' +
	'			<table width="165" cellpadding="2" cellspacing="0" border="0">' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="1" border="0" alt=""></td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/whatis.cfm\'">' + makeLink('/asbestos/whatis.cfm','What is Asbestos') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/questions.cfm\'">' + makeLink('/asbestos/questions.cfm','Asbestos Questions/Answers') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/industry.cfm\'">' + makeLink('/asbestos/industry.cfm','The Asbestos Industry') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/exposure_workplace.cfm\'">' + makeLink('/asbestos/exposure_workplace.cfm','Exposure in the Workplace') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/exposure_military.cfm\'">' + makeLink('/asbestos/exposure_military.cfm','Exposure in the Military') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/exposure_shipyard.cfm\'">' + makeLink('/asbestos/exposure_shipyard.cfm','Shipyard Exposure') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/exposure_home.cfm\'">' + makeLink('/asbestos/exposure_home.cfm','Exposure in the Home') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos/exposure_environmental.cfm\'">' + makeLink('/asbestos/exposure_environmental.cfm','Environmental Exposure') + '</td></tr>' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="2" border="0" alt=""></td></tr>' +
	'			</table>' +
	'	</td></tr></TABLE>' +
	'</TD></TR></TABLE>';
	
	var menu3Text = '<TABLE class="dropdown" onMouseOver="changeImages(\'image3\', \'image3on\');" onMouseOut="changeImages(\'image3\', \'image3off\');" cellpadding="1" cellspacing="0" border="0" bgcolor="black"><TR><TD><TABLE bgcolor="#FFFFFF" cellpadding="1" cellspacing="0" border="0"><TR><TD>' +
	'			<table width="120" cellpadding="2" cellspacing="0" border="0">' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="1" border="0" alt=""></td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/asbestos\'">' + makeLink('/asbestos','Asbestos') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/practice/personalinjury.cfm\'">' + makeLink('/practice/personalinjury.cfm','Personal Injury') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/practice/wrongfuldeath.cfm\'">' + makeLink('/practice/wrongfuldeath.cfm','Wrongful Death') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/practice/realestate.cfm\'">' + makeLink('/practice/realestate.cfm','Real Estate') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/practice/business.cfm\'">' + makeLink('/practice/business.cfm','Business') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/practice/civillitigation.cfm\'">' + makeLink('/practice/civillitigation.cfm','Civil Litigation') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#000000\'; this.style.backgroundColor=\'#8EB1D7\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\'; this.style.backgroundColor=\'\';" onClick="location.href=\'/practice/othertoxictorts.cfm\'">' + makeLink('/practice/othertoxictorts.cfm','Other Toxic Torts') + '</td></tr>' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="2" border="0" alt=""></td></tr>' +
	'			</table>' +
	'	</td></tr></TABLE>' +
	'</TD></TR></TABLE>';
	
	var menu4Text = '<TABLE class="dropdown" onMouseOver="changeImages(\'image4\', \'image4on\');" onMouseOut="changeImages(\'image4\', \'image4off\');" cellpadding="1" cellspacing="0" border="0" bgcolor="black"><TR><TD><TABLE bgcolor="#000000" cellpadding="1" cellspacing="0" border="0"><TR><TD>' +
	'			<table width="100%" cellpadding="2" cellspacing="0" border="0">' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="1" border="0" alt=""></td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#FFFFFF\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\';" onClick="location.href=\'/recruiting/summerclerks.shtml\'">' + makeLink('/recruiting/summerclerks.shtml','Summer Clerkship Program') + '</td></tr>' +
	'				<tr><td class="dropitem" onMouseOver="this.style.color=\'#FFFFFF\'; this.style.cursor=\'hand\';" onMouseOut="this.style.color=\'\';" onClick="location.href=\'/recruiting/openings.shtml\'">' + makeLink('/recruiting/openings.shtml','Available Positions') + '</td></tr>' +
	'				<tr><td><img src="images/blnk.gif" width="1" height="2" border="0" alt=""></td></tr>' +
	'			</table>' +
	'	</td></tr></TABLE>' +
	'</TD></TR></TABLE>';
	
	
		
	// ------------------- Menu Init function ----------//
	function invokeMenu1(MenuID,MenuText,leftPos,topPos)
	{
		if (V4)
			if (NS4)
				document.write('<layer onMouseOut="popOut(\'' + MenuID +'\');" onMouseOver="clearTimeout(TimerID); popUp(\'' + MenuID + '\');" id="' + MenuID +'" left="'+ leftPos +'" top="'+ topPos +'" visibility="hide" border="0">' + MenuText + '<\/layer>');
			else
				document.write('<DIV onMouseOut="popOut(\'' + MenuID +'\');" onMouseOver="clearTimeout(TimerID); popUp(\'' + MenuID + '\');" ID="' + MenuID +'" STYLE="position:absolute; border: 0; z-index:20; left: '+leftPos+'px; top: '+topPos+'px; visibility: hidden">' + MenuText + '<\/DIV>');
	
		return true;
	}
	
	// ------------------- Menu Display (pop-up) function -----------//
	function popUp(LayerID)
	{
		if (LoadDone == true)
		{
			clearTimeout(TimerID);
			
			if (GlobalLayer != "xx")
				popDown(GlobalLayer);
			
			if (V4)
				if (NS4)
					document.layers[LayerID].visibility = "show";
				else if (NS6)
					document.getElementById(LayerID).style.visibility = "visible";
				else
					document.all[LayerID].style.visibility = "visible";
			
			GlobalLayer = LayerID;  
		}
	}
	
	function popUpRel(LayerID, el)
	{
		if (LoadDone == true)
		{
			var xPos = el.x;
			var yPos = el.y;
			if(!xPos)
				xPos = getLeft(el);
			if(!yPos)
				yPos = getTop(el);
			
/*			switch(LayerID)
			{
				default:
					xPos += el.width
			}
	*/		
			clearTimeout(TimerID);
			
			if (GlobalLayer != "xx" && GlobalLayer != LayerID)
				popDown(GlobalLayer);
			
			if (V4)
				if (NS4)
				{
					with(document.layers[LayerID])
					{
						top = yPos + 30;
						left = xPos - 8;
						visibility = "show";
					}
				}
				else if (NS6)
				{
					document.getElementById(LayerID).style.top = yPos + 30;
					document.getElementById(LayerID).style.left = xPos - 8;	
					document.getElementById(LayerID).style.visibility = "visible";
				}
				else
				{
					with(document.all[LayerID].style)
					{
						top = yPos + 30;
						left = xPos - 8;
						visibility = "visible";
					}
				}
			GlobalLayer = LayerID;  
		}
	}

	// ------------------- Menu hide (pop-down) function -----------//
	function popDown(LayerID)
	{
		if (LoadDone == true)
		{
			if (V4)
			{
				if (LayerID == "stub")
					LayerID = GlobalLayer;
				
				if (NS4)
					document.layers[LayerID].visibility = "hide";
				else if (NS6)
					document.getElementById(LayerID).style.visibility = "hidden";
				else
					document.all[LayerID].style.visibility = "hidden";
			}
			GlobalLayer = "xx";  
		}
	}
	
	// ------------------ Set Timeout on Menu ---------------------//
	function popOut(LayerID)
	{
		if (LoadDone == true)
		{
			GlobalLayer = LayerID;
			if (V4)
				TimerID = setTimeout("popDown('stub')",200);
		} 
	}
	
	if (V4)
	{
	  invokeMenu1('PM1',menu1Text,153,103);
	  invokeMenu1('PM2',menu2Text,153,103);
	  invokeMenu1('PM3',menu3Text,153,103);
	  invokeMenu1('PM4',menu4Text,153,103);

	}
	LoadDone=true;
	
	function getLeft(el){
	    xPos = el.offsetLeft;
	    tempEl = el.offsetParent;
	    while (tempEl != null){
	        xPos += tempEl.offsetLeft;
	        tempEl = tempEl.offsetParent;
	    }
	    return xPos;
	}
	
	function getTop(el){
	    yPos = el.offsetTop;
	    tempEl = el.offsetParent;
	    while (tempEl != null){
	        yPos += tempEl.offsetTop;
	        tempEl = tempEl.offsetParent;
	    }
	    return yPos;
	}
	
	function drawNav(el)
	{
		//Get x,y coordinates. Check for NS first, then go for IE method if that failes
		var xPos = el.x;
		var yPos = el.y;
		if(!xPos)
			xPos = getLeft(el);
		if(!yPos)
			yPos = getTop(el);
		
		//Reposition DIVs
		if (V4)
		    if (NS4)
			{
				document.layers["PMNav"].left = xPos - 150;
				document.layers["PMNav"].top  = yPos;
			}
			else if (NS6)
			{
				document.getElementById("PMNav").style.left = xPos - 125;
				document.getElementById("PMNav").style.top = yPos - 5;
			}
			else
			{
				document.all["PMNav"].style.left = xPos - 140;
				document.all["PMNav"].style.top  = yPos - 0;
			}		

		//Popup menu
		popUp('PMNav');
	}
