var IE = document.all?true:false;// Is the browser IE??
$("document").ready(function(){
//=================Menu Hover Effect====================
$(".navBar").mouseover(function(){
//---------------Mouse Over--------------
$(this).addClass("navOver"); 
addFloatBox($(this).attr("offsetTop")+20,$(this).attr("offsetLeft"),getText($(this).attr("id")));
$("#popUpBox").hide();
$("#popUpBox").fadeIn("slow", function(){});
//---------------------------------------
});
$(".navBar").mouseout(function(){
//---------------Mouse Out --------------
$(this).removeClass("navOver");
removeFloatBox();
//---------------------------------------
});
$(".navBar").mousedown(function(){
//---------------Mouse Out --------------
removeFloatBox();

//---------------------------------------
});});

//========================================================
function getText(theId)
{
	switch (theId)
	{
		case "homeB": return "Return to Automation Plastics Home &nbsp;&nbsp;"; break;
		case "coB": return "Learn about our team and philosophy &nbsp;&nbsp;"; break;
		case "serveB": return "We detail our expertise in all aspects of engineering, tooling, and injection molding &nbsp;&nbsp;"; break;
		case "contactB": return "Contact Automation Plastics &nbsp;&nbsp;"; break;
		case "pressB": return "See Breaking Automation Plastics news &nbsp;&nbsp;"; break;
		case "blogB": return "See what is happening at Automation Plastics at our blog. &nbsp;&nbsp;"; break;
		default: return "";
	}
}
//================= Places Floating Div ====================
function addFloatBox(posTop,posLeft,theText)
{
	
	var windowContent;
	var newWindow = document.createElement("div"); // sets the newWindow to make a new div.

	//set Attributes.
		 newWindow.id = "popUpBox";
		 //style here cause IE doesn't like setAttribute.
		 newWindow.style.position="absolute";
		 newWindow.style.left=posLeft +"px";
		 newWindow.style.top=posTop + "px";
		 newWindow.style.fontFamily="Verdana, impact, sans-serif;"
		 newWindow.style.fontSize=".7em";
		 newWindow.style.fontVariant="small-caps";
		 newWindow.style.borderLeft="1px solid black";
		 //newWindow.style.borderTop="1px solid black"; //looks better w/o
		 newWindow.style.borderBottom="1px solid black";
		 
		 newWindow.innerHTML = '<img src="images/bullet.gif" style="position:relative; left:-10px" alt="O" />' + theText;
		 
	//Place Window
		document.body.appendChild(newWindow);
		//document.getElementById("popUpBox").setAttribute("class", "popUpText");
}
//==============Removes Div =====================
function removeFloatBox()
{
document.body.removeChild(document.getElementById("popUpBox"))
}



