// JavaScript Documentvar preloaded = [];

		// here is a lame preloading script i am putting in just for demonstration
		for (var i = 1; i <= 7; i++) {
			preloaded[i] = [loadImage(i + "-0.gif"), loadImage(i + "-1.gif")];
		}

		function init() {
			// whatever stuff you need to do onload goes here.

			//==========================================================================================
			// if supported, initialize graniteDropDowns
			//==========================================================================================
			// Check isSupported() so that menus aren't accidentally sent to non-supporting browsers.
			// This is better than server-side checking because it will also catch browsers which would
			// normally support the menus but have javascript disabled.
			//
			// If supported, call initialize() and then hook whatever image rollover code you need to do
			// to the .onactivate and .ondeactivate events for each menu.
			//==========================================================================================
			if (graniteDropDown.isSupported()) {
				graniteDropDown.initialize();

				// hook all the image swapping of the main toolbar to menu activation/deactivation
				// instead of simple rollover to get the effect where the button stays hightlit until
				// the menu is closed.

				//menu1.onactivate = function() { swapImage("button1", preloaded[1][1].src) };
				//menu1.ondeactivate = function() { swapImage("button1", preloaded[1][0].src) };

				menu2.onactivate = function() { swapImage("button2", preloaded[2][1].src) };
				if(section == "About"){
					menu2.ondeactivate = function() { swapImage("button2", preloaded[2][1].src) };
				} else {
					menu2.ondeactivate = function() { swapImage("button2", preloaded[2][0].src) };
				}

				menu3.onactivate = function() { swapImage("button3", preloaded[3][1].src) };
				if(section == "CServices"){
					menu3.ondeactivate = function() { swapImage("button3", preloaded[3][1].src) };
				} else {
					menu3.ondeactivate = function() { swapImage("button3", preloaded[3][0].src) };
				}

				menu4.onactivate = function() { swapImage("button4", preloaded[4][1].src) };
				if(section == "CMaterials"){
					menu4.ondeactivate = function() { swapImage("button4", preloaded[4][1].src) };
				} else {
					menu4.ondeactivate = function() { swapImage("button4", preloaded[4][0].src) };
				}

				menu5.onactivate = function() { swapImage("button5", preloaded[5][1].src) };
				if(section == "IR"){
					menu5.ondeactivate = function() { swapImage("button5", preloaded[5][1].src) };
				} else if (section == "Home") {
					menu5.ondeactivate = function() { swapImage("button5", preloaded[5][0].src); document.getElementById('HomePageLinks').style.visibility = 'visible'; };
				} else {
					menu5.ondeactivate = function() { swapImage("button5", preloaded[5][0].src) };
				}

				menu6.onactivate = function() { swapImage("button6", preloaded[6][1].src) };
				if(section == "Careers"){
					menu6.ondeactivate = function() { swapImage("button6", preloaded[6][1].src) };
				} else {
					menu6.ondeactivate = function() { swapImage("button6", preloaded[6][0].src) };
				}

				menu7.onactivate = function() { swapImage("button7", preloaded[7][1].src) };
				if(section == "Contact"){
					menu7.ondeactivate = function() { swapImage("button7", preloaded[7][1].src) };
				} else {
					menu7.ondeactivate = function() { swapImage("button7", preloaded[7][0].src) };
				}
			}
		}


		function loadImage(sFilename) {
			var img = new Image();
			img.src = urlRoot + "/images/" + sFilename;
			return img;
		}


		function swapImage(imgName, sFilename) {
			document.images[imgName].src = sFilename;
		}
		// set up drop downs anywhere in the body of the page. I think the bottom of the page is better.. 
	// but you can experiment with effect on loadtime.
	if (graniteDropDown.isSupported()) {

		//==================================================================================================
		// create a set of dropdowns
		//==================================================================================================
		// the first param should always be down, as it is here
		//
		// The second and third param are the top and left offset positions of the menus from their actuators
		// respectively. To make a menu appear a little to the left and bottom of an actuator, you could use
		// something like -5, 5
		//
		// The last parameter can be .topLeft, .bottomLeft, .topRight, or .bottomRight to inidicate the corner
		// of the actuator from which to measure the offset positions above. Here we are saying we want the 
		// menu to appear directly below the bottom left corner of the actuator
		//==================================================================================================
		var ms = new graniteDropDownSet(graniteDropDown.direction.down, 0, 0, graniteDropDown.reference.bottomLeft);

		//==================================================================================================
		// create a dropdown menu
		//==================================================================================================
		// the first parameter should be the HTML element which will act actuator for the menu
		//==================================================================================================
		//var menu1 = ms.addMenu(document.getElementById("menu1"));
		//menu1.addItem("- Code of Conduct", "#"); // send no URL if nothing should happen onclick
		
		var menu2 = ms.addMenu(document.getElementById("menu2"));
		menu2.addItem("- Code of Conduct", urlRoot + "/about-us/codeofconduct.cfm"); // send no URL if nothing should happen onclick
		menu2.addItem("- Safety", urlRoot + "/about-us/safety.cfm");
		menu2.addItem("- Environmental", urlRoot + "/about-us/environment.cfm");
		menu2.addItem("- Our Company", "/about-us/ourcompany.cfm");
		menu2.addItem("- Board of Directors", urlRoot + "/about-us/boardofdirectors.cfm");
		menu2.addItem("- Our History", urlRoot + "/about-us/ourhistory.cfm");
		menu2.addItem("- Our Achievements", urlRoot + "/about-us/reputation-awards.cfm");
		menu2.addItem("- Location Search", urlRoot + "/about-us/locationsearch.cfm");
		menu2.addItem("- Granite Store", urlRoot + "/transfer.cfm?redirect=https://www.costore.com/graniteconstruction");
		
		
		//==================================================================================================

		//==================================================================================================
		// add a sub-menu
		//==================================================================================================
		// to add a sub menu to an existing menu object, call it's addMenu method and pass it the item from
		// the parent menu which should act as it's actuator. To add a submenu to the fourth item of a menu
		// called "theMenu", you would do theMenu.addMenu(theMenu.items[3])
		//==================================================================================================
		// submenu
		var subMenu2 = menu2.addMenu(menu2.items[3]);
		subMenu2.addItem("- Administration", urlRoot + "/about-us/administration.cfm");
		subMenu2.addItem("- Heavy Construction Division (HCD)", "/about-us/hcd.cfm");
		subMenu2.addItem("- Branch Division", "/about-us/branch.cfm");
		subMenu2.addItem("- Equipment Department", urlRoot + "/about-us/equipment.cfm");
		subMenu2.addItem("- Granite Land Company", urlRoot + "/about-us/granite-land-company.cfm");
		subMenu2.addItem("- Leadership", urlRoot + "/about-us/leadership.cfm");
		subMenu2.addItem("- Affiliates", "/about-us/affiliates.cfm");
		subMenu2.addItem("- Partnerships", urlRoot + "/about-us/partnerships.cfm");
		
		
		// menu
    	var menu3 = ms.addMenu(document.getElementById("menu3"));
		menu3.addItem("- Roads & Highway Construction", urlRoot + "/construction-services/roads-hwy-construction.cfm");
		menu3.addItem("- Grading & Paving", urlRoot + "/construction-services/grading-paving.cfm");
		menu3.addItem("- Excavation & Mining", urlRoot + "/construction-services/excavation-mining.cfm");
		menu3.addItem("- Design/Build", urlRoot + "/construction-services/design-build.cfm");
		menu3.addItem("- Bridges & Structures", urlRoot + "/construction-services/bridges-structures.cfm");
		menu3.addItem("- Airport Infrastructure", urlRoot + "/construction-services/airport-infrastructure.cfm");
		menu3.addItem("- Rapid Transit & Railway", urlRoot + "/construction-services/rapid-transit-railway.cfm");
		menu3.addItem("- Dams, Locks & Levees", urlRoot + "/construction-services/dams-locks-levees.cfm");
		menu3.addItem("- Commercial/Residential Sitework", urlRoot + "/construction-services/comm-res-sitework.cfm");
		menu3.addItem("- Private Markets/Custom Work", urlRoot + "/construction-services/private-custom.cfm");
		menu3.addItem("- Underground, Pipe & Utilities", urlRoot + "/construction-services/underground.cfm");
		menu3.addItem("- Water/Waste Water Systems", urlRoot + "/construction-services/water-systems.cfm");
		menu3.addItem("- Recreational Facilities/Golf Courses", urlRoot + "/construction-services/recfacilities-golf.cfm");
		menu3.addItem("- Pavement Maintenance", urlRoot + "/construction-services/pavement.cfm");
		menu3.addItem("- Landfill/Environmental Remediation", urlRoot + "/construction-services/landfill-environmental.cfm");
		menu3.addItem("- Project & Land Development", urlRoot + "/construction-services/project-land-dev.cfm");
		
		// menu
		var menu4 = ms.addMenu(document.getElementById("menu4"));
		menu4.addItem("- Locate Facilities", urlRoot + "/construction-materials/locate-facilities.cfm");
		menu4.addItem("- Products", "/construction-materials/products.cfm");
		menu4.addItem("- Materials Safety Data Sheets", "/construction-materials/msds.cfm");
		menu4.addItem("- Career Opportunities", "http://granite.hodesiq.com/");
		menu4.addItem("- Credit Applications", urlRoot + "/construction-materials/materials-creditapp.cfm");
		menu4.addItem("- Engineering Services QC/QA", urlRoot + "/construction-materials/engineering-services.cfm");
		menu4.addItem("- Our Neighborhood", urlRoot + "/construction-materials/our-neighborhood.cfm");
		menu4.addItem("- Materials Calculators", urlRoot + "/construction-materials/materials-calculators.cfm");
		menu4.addItem("- Surplus Equipment For Sale", urlRoot + "/construction-materials/surplusequipment.cfm");

		// submenu
		var subMenu4 = menu4.addMenu(menu4.items[1]);
		subMenu4.addItem("- Ready Mix", urlRoot + "/construction-materials/readymix.cfm");
		subMenu4.addItem("- Aggregate", urlRoot + "/construction-materials/aggregate.cfm");
		subMenu4.addItem("- Hot Mix Asphalt", urlRoot + "/construction-materials/asphalt-concrete.cfm");
		
		// submenu
		var subMenu4 = menu4.addMenu(menu4.items[7]);
		subMenu4.addItem("- Aggregate", urlRoot + "/construction-materials/aggregate-calculator.cfm");
		subMenu4.addItem("- Concrete", urlRoot + "/construction-materials/concrete-calculator.cfm");
		subMenu4.addItem("- Road Materials", urlRoot + "/construction-materials/roadmaterials-calculator.cfm");
		subMenu4.addItem("- Unit Conversion", urlRoot + "/construction-materials/unit-calculator.cfm");

		// menu
		var menu5 = ms.addMenu(document.getElementById("menu5"));
		menu5.addItem("- Granite Overview", urlRoot + "/investor-relations/granite-overview.cfm");
		menu5.addItem("- Stock Quote", urlRoot + "/investor-relations/stock-quote.cfm");
		menu5.addItem("- News Releases", urlRoot + "/investor-relations/news-releases.cfm");
		menu5.addItem("- Email Alerts", urlRoot + "/investor-relations/email-alerts.cfm");
		menu5.addItem("- Calendar", urlRoot + "/investor-relations/calendar.cfm");
		menu5.addItem("- Presentations", urlRoot + "/investor-relations/presdisclaimer.cfm");
		menu5.addItem("- Webcasts", urlRoot + "/investor-relations/webcasts.cfm");
		menu5.addItem("- Corporate Governance Highlights", "/investor-relations/corporate-governance.cfm");
		menu5.addItem("- Annual Report", urlRoot + "/investor-relations/annual-report.cfm");
		menu5.addItem("- Financials", urlRoot + "/investor-relations/financial-info.cfm");
		menu5.addItem("- Earnings Estimates", urlRoot + "/investor-relations/earnings-estimates.cfm");
		menu5.addItem("- Analyst Coverage", urlRoot + "/investor-relations/analyst-coverage.cfm");
		menu5.addItem("- SEC Filings", urlRoot + "/investor-relations/sec-filings.cfm");
		menu5.addItem("- Stock Purchase", urlRoot + "/investor-relations/stock-purchase.cfm");
		menu5.addItem("- FAQ", urlRoot + "/investor-relations/faq.cfm");
		menu5.addItem("- Information Request", urlRoot + "/investor-relations/info-request.cfm");
		
		var subMenu5 = menu5.addMenu(menu5.items[7]);
		subMenu5.addItem("- Board of Directors", urlRoot + "/investor-relations/board-of-directors.cfm");
		subMenu5.addItem("- Leadership", urlRoot + "/investor-relations/leadership.cfm");

		// menu
		var menu6 = ms.addMenu(document.getElementById("menu6"));
		menu6.addItem("- Why Granite?", "/careers/why-granite.cfm");
		menu6.addItem("- Life at Granite", urlRoot + "/careers/life-at-granite.cfm");
		menu6.addItem("- Current Opportunities", "http://granite.hodesiq.com/");
		menu6.addItem("- Career Contacts", urlRoot + "/careers/career-contacts.cfm");
		menu6.addItem("- College Recruiting", urlRoot + "/careers/college-recruiting.cfm");
		menu6.addItem("- Benefits", urlRoot + "/careers/benefits.cfm");

		var subMenu6 = menu6.addMenu(menu6.items[0]);
		subMenu6.addItem("- Employee Development", urlRoot + "/careers/edi.cfm");
		subMenu6.addItem("- Character", urlRoot + "/careers/character.cfm");
		subMenu6.addItem("- Social Responsibility", urlRoot + "/careers/social-responsibility.cfm");
		subMenu6.addItem("- Community Involvement", urlRoot + "/careers/community-involvement.cfm");
		subMenu6.addItem("- Making a Difference", urlRoot + "/careers/making-a-difference.cfm");
		
		var subMenu6 = menu6.addMenu(menu6.items[4]);
		subMenu6.addItem("- Const. Mgmt. Competition", urlRoot + "/careers/constr-mgmt-competition.cfm");

		// menu
		var menu7 = ms.addMenu(document.getElementById("menu7"));

		menu7.addItem("- Map & Directions", urlRoot + "/contact-us/corpmap.cfm");

		//==================================================================================================
		// write drop downs into page
		//==================================================================================================
		// this method writes all the HTML for the menus into the page with document.write(). It must be
		// called within the body of the HTML page.
		//==================================================================================================
		graniteDropDown.renderAll();
	}
/* =================================================================================================
* Copyright 2003, Aaron Boodman (aaron@youngpup.net)
* =================================================================================================
* "Can I use this?"
*
* Use of this library is governed by the Creative Commons Attribution-NonCommercial-ShareAlike 1.0
* License. You can check it out at: http://creativecommons.org/licenses/by-nc-sa/1.0
*
* Basically:
* - You may copy, distribute, and eat this code as you wish. But you must give me credit for
* writing it. You may not misrepresent yourself as the author of this code.
* - You may not use this code in a commercial setting without prior consent from me.
* - If you make changes to this code, you must make the changes available under a license like
* this one.
* =================================================================================================
* "It's kinda hard to read, though"
* ============================================================================================== */



graniteDropDown.spacerGif = urlRoot + "/images/x.gif";
graniteDropDown.dingbatOn = urlRoot + "/images/expand-1.gif";
graniteDropDown.dingbatOff = urlRoot + "/images/expand-0.gif";
graniteDropDown.dingbatSize = 14;
graniteDropDown.menuPadding = 1;
graniteDropDown.itemPadding = 4;
graniteDropDown.shadowSize = 2;
graniteDropDown.shadowOffset = 3;
graniteDropDown.shadowColor = "#888";
graniteDropDown.shadowPng = urlRoot + "/images/grey-40.png";
graniteDropDown.backgroundColor = "#E6E6E6";
graniteDropDown.backgroundPng = urlRoot + "/images/white-90.png";
graniteDropDown.hideDelay = 1000;
graniteDropDown.slideTime = 200;



graniteDropDown.reference = {topLeft:1,topRight:2,bottomLeft:3,bottomRight:4};
graniteDropDown.direction = {down:1,right:2};
graniteDropDown.registry = [];
graniteDropDown._maxZ = 100;




graniteDropDown.isSupported = function() {
if (typeof graniteDropDown.isSupported.r == "boolean")
return graniteDropDown.isSupported.r;
var ua = navigator.userAgent.toLowerCase();
var an = navigator.appName;
var r = false;
if (ua.indexOf("gecko") > -1) r = true;
else if (an == "Microsoft Internet Explorer") {
if (document.getElementById) r = true;
}
graniteDropDown.isSupported.r = r;
return r;
}

graniteDropDown.initialize = function() {
for (var i = 0, menu = null; menu = this.registry[i]; i++) {
menu.initialize();
}
}

graniteDropDown.renderAll = function() {
var aMenuHtml = [];
for (var i = 0, menu = null; menu = this.registry[i]; i++) {
aMenuHtml[i] = menu.toString();
}
document.write(aMenuHtml.join(""));
}

function graniteDropDown(oActuator, iDirection, iLeft, iTop, iReferencePoint, parentMenuSet) {

this.addItem = addItem;
this.addMenu = addMenu;
this.toString = toString;
this.initialize = initialize;
this.isOpen = false;
this.show = show;
this.hide = hide;
this.items = [];

this.onactivate = new Function();
this.ondeactivate = new Function();
this.onmouseover = new Function();
this.onqueue = new Function();

this.index = graniteDropDown.registry.length;
graniteDropDown.registry[this.index] = this;
var id = "graniteDropDown" + this.index;
var contentHeight = null;
var contentWidth = null;
var childMenuSet = null;
var animating = false;
var childMenus = [];
var slideAccel = -1;
var elmCache = null;
var ready = false;
var _this = this;
var a = null;
var pos = iDirection == graniteDropDown.direction.down ? "top" : "left";
var dim = null;

function addItem(sText, sUrl) {
var item = new graniteDropDownItem(sText, sUrl, this);
item._index = this.items.length;
this.items[item._index] = item;
}
function addMenu(oMenuItem) {
if (!oMenuItem.parentMenu == this) throw new Error("Cannot add a menu here");
if (childMenuSet == null) childMenuSet = new graniteDropDownSet(graniteDropDown.direction.right, -5, 2, graniteDropDown.reference.topRight);
var m = childMenuSet.addMenu(oMenuItem);
childMenus[oMenuItem._index] = m;
m.onmouseover = child_mouseover;
m.ondeactivate = child_deactivate;
m.onqueue = child_queue;
return m;
}
function initialize() {
initCache();
initEvents();
initSize();
ready = true;
}
function show() {
if (ready) {
_this.isOpen = true;
animating = true;
setContainerPos();
elmCache["clip"].style.visibility = "visible";
elmCache["clip"].style.zIndex = graniteDropDown._maxZ++;

slideStart();
_this.onactivate();
}
}
function hide() {
if (ready) {
_this.isOpen = false;
animating = true;
for (var i = 0, item = null; item = elmCache.item[i]; i++)
dehighlight(item);
if (childMenuSet) childMenuSet.hide();
slideStart();
_this.ondeactivate();
}
}
function setContainerPos() {
var sub = oActuator.constructor == graniteDropDownItem;
var act = sub ? oActuator.parentMenu.elmCache["item"][oActuator._index] : oActuator;
var el = act;
var x = 0;
var y = 0;
var minX = 0;
var maxX = (window.innerWidth ? window.innerWidth : document.body.clientWidth) - parseInt(elmCache["clip"].style.width);
var minY = 0;
var maxY = (window.innerHeight ? window.innerHeight : document.body.clientHeight) - parseInt(elmCache["clip"].style.height);

while (sub ? el.parentNode.className.indexOf("graniteDropDownMenu") == -1 : el.offsetParent) {
x += el.offsetLeft;
y += el.offsetTop;
if (el.scrollLeft) x -= el.scrollLeft;
if (el.scrollTop) y -= el.scrollTop;
el = el.offsetParent;
}
if (oActuator.constructor == graniteDropDownItem) {
x += parseInt(el.parentNode.style.left);
y += parseInt(el.parentNode.style.top);
}
switch (iReferencePoint) {
case graniteDropDown.reference.topLeft:
break;
case graniteDropDown.reference.topRight:
x += act.offsetWidth;
break;
case graniteDropDown.reference.bottomLeft:
y += act.offsetHeight;
break;
case graniteDropDown.reference.bottomRight:
x += act.offsetWidth;
y += act.offsetHeight;
break;
}
x += iLeft;
y += iTop;
x = Math.max(Math.min(x, maxX), minX);
y = Math.max(Math.min(y, maxY), minY);
elmCache["clip"].style.left = x + "px";
elmCache["clip"].style.top = y + "px";
}
function slideStart() {
var x0 = parseInt(elmCache["content"].style[pos]);
var x1 = _this.isOpen ? 0 : -dim;
if (a != null) a.stop();
a = new Accelimation(x0, x1, graniteDropDown.slideTime, slideAccel);
a.onframe = slideFrame;
a.onend = slideEnd;
a.start();
}
function slideFrame(x) {
elmCache["content"].style[pos] = x + "px";
}
function slideEnd() {
if (!_this.isOpen) elmCache["clip"].style.visibility = "hidden";
animating = false;
}
function initSize() {

var ow = elmCache["items"].offsetWidth;
var oh = elmCache["items"].offsetHeight;
var ua = navigator.userAgent.toLowerCase();

elmCache["clip"].style.width = ow + graniteDropDown.shadowSize + 2 + "px";
elmCache["clip"].style.height = oh + graniteDropDown.shadowSize + 2 + "px";

elmCache["content"].style.width = ow + graniteDropDown.shadowSize + "px";
elmCache["content"].style.height = oh + graniteDropDown.shadowSize + "px";
contentHeight = oh + graniteDropDown.shadowSize;
contentWidth = ow + graniteDropDown.shadowSize;
dim = iDirection == graniteDropDown.direction.down ? contentHeight : contentWidth;

elmCache["content"].style[pos] = -dim - graniteDropDown.shadowSize + "px";
elmCache["clip"].style.visibility = "hidden";

if (ua.indexOf("mac") == -1 || ua.indexOf("gecko") > -1) {

elmCache["background"].style.width = ow + "px";
elmCache["background"].style.height = oh + "px";
elmCache["background"].style.backgroundColor = graniteDropDown.backgroundColor;

elmCache["shadowRight"].style.left = ow + "px";
elmCache["shadowRight"].style.height = oh - (graniteDropDown.shadowOffset - graniteDropDown.shadowSize) + "px";
elmCache["shadowRight"].style.backgroundColor = graniteDropDown.shadowColor;



elmCache["shadowBottom"].style.top = oh + "px";
elmCache["shadowBottom"].style.width = ow - graniteDropDown.shadowOffset + "px";
elmCache["shadowBottom"].style.backgroundColor = graniteDropDown.shadowColor;
}

else {

elmCache["background"].firstChild.src = graniteDropDown.backgroundPng;
elmCache["background"].firstChild.width = ow;
elmCache["background"].firstChild.height = oh;

elmCache["shadowRight"].firstChild.src = graniteDropDown.shadowPng;
elmCache["shadowRight"].style.left = ow + "px";
elmCache["shadowRight"].firstChild.width = graniteDropDown.shadowSize;
elmCache["shadowRight"].firstChild.height = oh - (graniteDropDown.shadowOffset - graniteDropDown.shadowSize);



elmCache["shadowBottom"].firstChild.src = graniteDropDown.shadowPng;
elmCache["shadowBottom"].style.top = oh + "px";
elmCache["shadowBottom"].firstChild.height = graniteDropDown.shadowSize;
elmCache["shadowBottom"].firstChild.width = ow - graniteDropDown.shadowOffset;
}
}
function initCache() {
var menu = document.getElementById(id);
var all = menu.all ? menu.all : menu.getElementsByTagName("*");
elmCache = {};
elmCache["clip"] = menu;
elmCache["item"] = [];
for (var i = 0, elm = null; elm = all[i]; i++) {
switch (elm.className) {
case "items":
case "content":
case "background":
case "shadowRight":
case "shadowBottom":
elmCache[elm.className] = elm;
break;
case "item":
elm._index = elmCache["item"].length;
elmCache["item"][elm._index] = elm;
break;
}
}

_this.elmCache = elmCache;
}
function initEvents() {

for (var i = 0, item = null; item = elmCache.item[i]; i++) {
item.onmouseover = item_mouseover;
item.onmouseout = item_mouseout;
item.onclick = item_click;
}

if (typeof oActuator.tagName != "undefined") {
oActuator.onmouseover = actuator_mouseover;
oActuator.onmouseout = actuator_mouseout;
}

elmCache["content"].onmouseover = content_mouseover;
elmCache["content"].onmouseout = content_mouseout;
}
function highlight(oRow) {
oRow.className = "item hover";
if (childMenus[oRow._index])
oRow.lastChild.firstChild.src = graniteDropDown.dingbatOn;
}
function dehighlight(oRow) {
oRow.className = "item";
if (childMenus[oRow._index])
oRow.lastChild.firstChild.src = graniteDropDown.dingbatOff;
}
function item_mouseover() {
if (!animating) {
highlight(this);
if (childMenus[this._index])
childMenuSet.showMenu(childMenus[this._index]);
else if (childMenuSet) childMenuSet.hide();
}
}
function item_mouseout() {
if (!animating) {
if (childMenus[this._index])
childMenuSet.hideMenu(childMenus[this._index]);
else
dehighlight(this);
}
}
function item_click() {
if (!animating) {
if (_this.items[this._index].url)
location.href = _this.items[this._index].url;
}
}

function actuator_mouseover()
{

	//  This function has been modified to facilitate selective hiding of the
	//  select menu, which is rendered in front of the Investor Relations menu
	//  in Internet Explorer 6 for Windows.

	if (this.id == 'menu5' && document.getElementById('HomePageLinks')) { document.getElementById('HomePageLinks').style.visibility = 'hidden'; }

	parentMenuSet.showMenu(_this);

}

function actuator_mouseout() {
parentMenuSet.hideMenu(_this);

}
function content_mouseover() {
if (!animating) {
parentMenuSet.showMenu(_this);
_this.onmouseover();

}
}
function content_mouseout() {
if (!animating) {
parentMenuSet.hideMenu(_this);
}

}
function child_mouseover() {
if (!animating) {
parentMenuSet.showMenu(_this);
}
}
function child_deactivate() {
for (var i = 0; i < childMenus.length; i++) {
if (childMenus[i] == this) {
dehighlight(elmCache["item"][i]);
break;
}
}
}
function child_queue() {
parentMenuSet.hideMenu(_this);
}
function toString() {
var aHtml = [];
var sClassName = "graniteDropDownMenu" + (oActuator.constructor != graniteDropDownItem ? " top" : "");
for (var i = 0, item = null; item = this.items[i]; i++) {
aHtml[i] = item.toString(childMenus[i]);
}
return '<div id="' + id + '" class="' + sClassName + '">' +
'<div class="content"><table class="items" cellpadding="0" cellspacing="0" border="0">' +
'<tr><td colspan="2"><img src="' + graniteDropDown.spacerGif + '" width="1" height="' + graniteDropDown.menuPadding + '"></td></tr>' +
aHtml.join('') +
'<tr><td colspan="2"><img src="' + graniteDropDown.spacerGif + '" width="1" height="' + graniteDropDown.menuPadding + '"></td></tr></table>' +

'<div class="shadowBottom"><img src="' + graniteDropDown.spacerGif + '" width="1" height="1"></div>' +
'<div class="shadowRight"><img src="' + graniteDropDown.spacerGif + '" width="1" height="1"></div>' +
'<div class="background"><img src="' + graniteDropDown.spacerGif + '" width="1" height="1"></div>' +
'</div></div>';
}
}








graniteDropDownSet.registry = [];
function graniteDropDownSet(iDirection, iLeft, iTop, iReferencePoint) {

this.addMenu = addMenu;
this.showMenu = showMenu;
this.hideMenu = hideMenu;
this.hide = hide;

var menus = [];
var _this = this;
var current = null;
this.index = graniteDropDownSet.registry.length;
graniteDropDownSet.registry[this.index] = this;

function addMenu(oActuator) {
var m = new graniteDropDown(oActuator, iDirection, iLeft, iTop, iReferencePoint, this);
menus[menus.length] = m;
return m;
}
function showMenu(oMenu) {
if (oMenu != current) {

if (current != null) hide(current);

current = oMenu;

oMenu.show();
}
else {

cancelHide(oMenu);
}
}
function hideMenu(oMenu) {

if (current == oMenu && oMenu.isOpen) {

if (!oMenu.hideTimer) scheduleHide(oMenu);
}
}
function scheduleHide(oMenu) {

oMenu.onqueue();
oMenu.hideTimer = window.setTimeout("graniteDropDownSet.registry[" + _this.index + "].hide(graniteDropDown.registry[" + oMenu.index + "])", graniteDropDown.hideDelay);
}
function cancelHide(oMenu) {

if (oMenu.hideTimer) {
window.clearTimeout(oMenu.hideTimer);
oMenu.hideTimer = null;
}
}
function hide(oMenu) {
if (!oMenu && current) oMenu = current;
if (oMenu && current == oMenu && oMenu.isOpen) {

cancelHide(oMenu);
current = null;
oMenu.hideTimer = null;
oMenu.hide();
}
}
}








function graniteDropDownItem(sText, sUrl, oParent) {
this.toString = toString;
this.text = sText;
this.url = sUrl;
this.parentMenu = oParent;
function toString(bDingbat) {
var sDingbat = bDingbat ? graniteDropDown.dingbatOff : graniteDropDown.spacerGif;
var iEdgePadding = graniteDropDown.itemPadding + graniteDropDown.menuPadding;
var sPaddingLeft = "padding:" + graniteDropDown.itemPadding + "px; padding-left:" + iEdgePadding + "px;"
var sPaddingRight = "padding:" + graniteDropDown.itemPadding + "px; padding-right:" + iEdgePadding + "px;"
return '<tr class="item"><td nowrap style="' + sPaddingLeft + '">' +
sText + '</td><td width="14" style="' + sPaddingRight + '">' +
'<img src="' + sDingbat + '" width="14" height="14"></td></tr>';
}
}


















function Accelimation(from, to, time, zip) {
if (typeof zip == "undefined") zip = 0;
if (typeof unit == "undefined") unit = "px";
this.x0 = from;
this.x1 = to;
this.dt = time;
this.zip = -zip;
this.unit = unit;
this.timer = null;
this.onend = new Function();
this.onframe = new Function();
}




Accelimation.prototype.start = function() {
this.t0 = new Date().getTime();
this.t1 = this.t0 + this.dt;
var dx = this.x1 - this.x0;
this.c1 = this.x0 + ((1 + this.zip) * dx / 3);
this.c2 = this.x0 + ((2 + this.zip) * dx / 3);
Accelimation._add(this);
}

Accelimation.prototype.stop = function() {
Accelimation._remove(this);
}




Accelimation.prototype._paint = function(time) {
if (time < this.t1) {
var elapsed = time - this.t0;
this.onframe(Accelimation._getBezier(elapsed/this.dt,this.x0,this.x1,this.c1,this.c2));
}
else this._end();
}

Accelimation.prototype._end = function() {
Accelimation._remove(this);
this.onframe(this.x1);
this.onend();
}




Accelimation._add = function(o) {
var index = this.instances.length;
this.instances[index] = o;

if (this.instances.length == 1) {
this.timerID = window.setInterval("Accelimation._paintAll()", this.targetRes);
}
}

Accelimation._remove = function(o) {
for (var i = 0; i < this.instances.length; i++) {
if (o == this.instances[i]) {
this.instances = this.instances.slice(0,i).concat( this.instances.slice(i+1) );
break;
}
}

if (this.instances.length == 0) {
window.clearInterval(this.timerID);
this.timerID = null;
}
}

Accelimation._paintAll = function() {
var now = new Date().getTime();
for (var i = 0; i < this.instances.length; i++) {
this.instances[i]._paint(now);
}
}

Accelimation._B1 = function(t) { return t*t*t }
Accelimation._B2 = function(t) { return 3*t*t*(1-t) }
Accelimation._B3 = function(t) { return 3*t*(1-t)*(1-t) }
Accelimation._B4 = function(t) { return (1-t)*(1-t)*(1-t) }

Accelimation._getBezier = function(percent,startPos,endPos,control1,control2) {
return endPos * this._B1(percent) + control2 * this._B2(percent) + control1 * this._B3(percent) + startPos * this._B4(percent);
}

Accelimation.instances = [];
Accelimation.targetRes = 10;
Accelimation.timerID = null;
<!--
function MM_reloadPage(init) {  //reloads the window if Nav4 resized
  if (init==true) with (navigator) {if ((appName=="Netscape")&&(parseInt(appVersion)==4)) {
    document.MM_pgW=innerWidth; document.MM_pgH=innerHeight; onresize=MM_reloadPage; }}
  else if (innerWidth!=document.MM_pgW || innerHeight!=document.MM_pgH) location.reload();
}
MM_reloadPage(true);

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];}}
}

// Set Netscape up to run the "captureMousePosition" function whenever
// the mouse is moved. For Internet Explorer and Netscape 6, you can capture
// the movement a little easier.
if (document.layers) { // Netscape
    document.captureEvents(Event.MOUSEMOVE);
    document.onmousemove = captureMousePosition;
} else if (document.all) { // Internet Explorer
    document.onmousemove = captureMousePosition;
} else if (document.getElementById) { // Netcsape 6
    document.onmousemove = captureMousePosition;
}
// Global variables
xMousePos = 0; // Horizontal position of the mouse on the screen
yMousePos = 0; // Vertical position of the mouse on the screen
xMousePosMax = 0; // Width of the page
yMousePosMax = 0; // Height of the page

function captureMousePosition(e) {
    if (document.layers) {
        // When the page scrolls in Netscape, the event's mouse position
        // reflects the absolute position on the screen. innerHight/Width
        // is the position from the top/left of the screen that the user is
        // looking at. pageX/YOffset is the amount that the user has 
        // scrolled into the page. So the values will be in relation to
        // each other as the total offsets into the page, no matter if
        // the user has scrolled or not.
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    } else if (document.all) {
        // When the page scrolls in IE, the event's mouse position 
        // reflects the position from the top/left of the screen the 
        // user is looking at. scrollLeft/Top is the amount the user
        // has scrolled into the page. clientWidth/Height is the height/
        // width of the current page the user is looking at. So, to be
        // consistent with Netscape (above), add the scroll offsets to
        // both so we end up with an absolute value on the page, no 
        // matter if the user has scrolled or not.
        xMousePos = window.event.x+document.body.scrollLeft;
        yMousePos = window.event.y+document.body.scrollTop;
        xMousePosMax = document.body.clientWidth+document.body.scrollLeft;
        yMousePosMax = document.body.clientHeight+document.body.scrollTop;
    } else if (document.getElementById) {
        // Netscape 6 behaves the same as Netscape 4 in this regard 
        xMousePos = e.pageX;
        yMousePos = e.pageY;
        xMousePosMax = window.innerWidth+window.pageXOffset;
        yMousePosMax = window.innerHeight+window.pageYOffset;
    }
	//window.status = "xMousePos=" + xMousePos + ", yMousePos=" + yMousePos + ", xMousePosMax=" + xMousePosMax + ", yMousePosMax=" + yMousePosMax;
}


function WM_checkIn(id) {

/*
Usage: WM_checkIn('id')
*/

  // This function checks for DOM strategy, then 
  // returns an object reference.
  if (document.all) {
    return document.all[id].style;
  } else if(document.layers) {
    return document.layers[id];
  }
}

// set hidden/visible vars for Netscape 4 compatibility
if (document.layers) {
  var hidden = "hide";
  var visible = "show";
} else {
  var hidden = "hidden";
  var visible = "visible";
}
var toggle = "toggle";

function WM_changeVisibility() {
  if (document.layers || document.all) {
    var inc, endInc=arguments.length;
    // run through the args (objects) and set the visibility of each
    for (inc=0; inc<endInc; inc+=2) {
      // get a good object reference
      var daObj = WM_checkIn(arguments[inc]);
      if (arguments[inc+1] == hidden) {
        // hide the object
        daObj.visibility = hidden;
      } else if (arguments[inc+1] == visible) {
        // show the object
        daObj.visibility = visible;
      } else if (arguments[inc+1] == toggle) {
        // toggle the object's visibility
        if (daObj.visibility == visible) {
          daObj.visibility = hidden;
        } else if (daObj.visibility == hidden) {
          daObj.visibility = visible;
        }
      }
    }
  }
}


function WM_moveTo(daObject, endLeft, endTop, numSteps, delay, endFunction) {


  // Declare variables.
  var leftInc, topInc, daObj = new Object;
  // The first time through, create document.WM.WM_moveTo
  if (typeof document.WM == 'undefined'){
    document.WM = new Object;
    document.WM.WM_moveTo = new Object;
  } else if (typeof document.WM.WM_moveTo == 'undefined') {
    document.WM.WM_moveTo = new Object;
  }
  // Store endFunction to execute when the move is finished.
  if(endFunction) document.WM.WM_moveTo.endFunction = endFunction;
  // Get a good object reference (call it daObj) from WM_checkIn().
  // But if we've already done so, don't check it in again.
    if (daObject == "sameObj") {
      daObj = document.WM.WM_moveTo.daObj;
    } else {
      daObj = WM_checkIn(daObject);
      document.WM.WM_moveTo.daObj = daObj;
    }
  // If this is the last step, go to the end point and run endFunction.
  if (numSteps == 1) {
    daObj.left = endLeft;
    daObj.top = endTop;
    // If an endFunction was set, execute it and then delete it.
    if(document.WM.WM_moveTo.endFunction) {
      daFunction = document.WM.WM_moveTo.endFunction;
      document.WM.WM_moveTo.endFunction = '';
      eval(daFunction);
    }
  } else {
    // Otherwise, figure out how far to move.
    leftInc = (endLeft - parseInt(daObj.left)) / numSteps;
    topInc = (endTop - parseInt(daObj.top)) / numSteps;
    // Then move, decrement numSteps, and do it all again.
    daObj.left = parseInt(daObj.left) + leftInc;
    daObj.top = parseInt(daObj.top) + topInc;
    numSteps--;
    setTimeout ('WM_moveTo(\'sameObj\', ' + endLeft + ', ' + endTop + ', ' + numSteps + ', ' + delay + ')', delay);
  }
}

function togglemenu(id) {
	var menuimg = document.getElementById("menuimg" + id);
	var submenuimg = document.getElementById("submenuimg" + id);
	var children = document.getElementById("childitems" + id);
	
	if(menuimg) {
		if(menuimg.src == urlRoot + "/images/menu_arrow_right.gif") {
			menuimg.src = urlRoot + "/images/menu_arrow_down.gif";
		}
		else {
			menuimg.src = urlRoot + "/images/menu_arrow_right.gif";
		}
	}
	
	if(submenuimg) {
		if(submenuimg.src == urlRoot + "/images/submenu_arrow_right.gif") {
			submenuimg.src = urlRoot + "/images/submenu_arrow_down.gif";
		}
		else {
			submenuimg.src = urlRoot + "/images/submenu_arrow_right.gif";
		}
	}
	
	if(children) {
		if(children.className == "collapsedchild") {
			children.className = "expandedchild";
		}
		else {
			children.className = "collapsedchild";
		}
	}
}


//-->
section = "Home";
	urlRoot = "http://www.tinca-service.ro";
	function setKbDimensions() {
		var oBody = document.body;
		var oFrame = document.all("kbframe");
		var navBarHeight = 108;
	}
	<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
  eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
  if (restore) selObj.selectedIndex=0;
}
//-->
