holdObject = null;

function over(ob) {
	active = (ob.childNodes[0].nodeValue.lastIndexOf("»") != -1);
	if(!active) {
		ob.childNodes[0].nodeValue = ob.childNodes[0].nodeValue + " »";
		ob.style.color = "#EA5A00";
	}
}

function out(ob, flag) {
	active = (ob.childNodes[0].nodeValue.lastIndexOf("»") != -1);
	if(active && ((ob != holdObject) || flag)) {
		oldValue = ob.childNodes[0].nodeValue;
		oldValue = oldValue.substring(0, oldValue.length - 2);
		ob.childNodes[0].nodeValue = oldValue;
		ob.style.color = "#93909F";
	}
}

function hold(ob) {
	if(holdObject != null) {
		if(holdObject != ob) {
			out(holdObject, true);
			over(ob);
			pullUp(holdObject.id);
			pullDown(ob.id);
			holdObject = ob;
		}
	} else {
		holdObject = ob;
	}
	
	return false;
}

function pullUp(id) {
	if(id == 'nav_service') {
		document.getElementById('nav_service_sub').className = 'hideMe';
	}
	if(id == 'nav_products') {
		document.getElementById('nav_products_sub').className = 'hideMe';
	}
	if(id == 'nav_company') {
		document.getElementById('nav_company_sub').className = 'hideMe';
	}
}

function pullDown(id) {
	if(id == 'nav_service') {
		document.getElementById('nav_service_sub').className = 'showMe';
	}
	if(id == 'nav_products') {
		document.getElementById('nav_products_sub').className = 'showMe';
	}
	if(id == 'nav_company') {
		document.getElementById('nav_company_sub').className = 'showMe';
	}
}

function init(page) {
	ob = document.getElementById("nav_" + page);
	over(ob);
	hold(ob);
}
