function getObj(name)
{
	if (document.getElementById)
  	{
		this.obj = document.getElementById(name);
		this.style = document.getElementById(name).style;
	}
	else if (document.all)
	{
		this.obj = document.all[name];
		this.style = document.all[name].style;
	}
	else if (document.layers)
	{
		this.obj = document.layers[name];
		this.style = document.layers[name];
	}
}

var currentItem = "";
var resizing = null;
function showMenu() {
	if (this.nextSibling.style.display == "none" || this.nextSibling.style.display == "") {
		this.parentNode.style.width = "180px";
		this.parentNode.childNodes[1].style.display = "block";
		if (currentItem != "") {
			var oldItem = new getObj(currentItem);
			oldItem.obj.childNodes[1].style.display = "none";
			oldItem.style.width = "30px";
			oldItem.obj.style.backgroundPosition = "0 0";
		}
		currentItem = this.parentNode.id;
	} else {
		this.parentNode.childNodes[1].style.display = "none";
		this.parentNode.style.width = "30px";
		currentItem = "";
	}
}
var nav = new getObj("navigation");
var i;
for (i = 0; i < nav.obj.childNodes.length; i++) {
	if (nav.obj.childNodes[i].tagName != null) {
		var headTag = document.getElementById("navigation").childNodes[i].tagName;
		if (headTag.toLowerCase() == "div") {
			nav.obj.childNodes[i].childNodes[0].onclick = showMenu;
		}
	}
}
function showSub() {
	if (this.childNodes[1].style.display == "" || this.childNodes[1].style.display == "none") {
		this.childNodes[1].style.display = "block";
	} else {
		this.childNodes[1].style.display = "none";
	}
}
var subMenus = ["aboutus", "community", "portfolio", "portfolio_de", "portfolio_en", "domains", "services"];
//GERD var navCategories = ["people", "innovation", "design"];
var navCategories = ["people", "design"];
for (i = 0; i < navCategories.length; i++) {
	
	var navItem = new getObj("nav-" + navCategories[i]);
		navItem.style.backgroundImage = "url(main-nav-" + navCategories[i] + ".gif)";
	navItem.style.backgroundRepeat = "no-repeat";
	var navNormal = "url(main-nav-" + navCategories[i] + "-normal.gif)"
	var navSelected = "url(main-nav-" + navCategories[i] + "-selected.gif)"
	
	navItem.obj.onmouseover = function() {
			this.style.backgroundPosition = "-30px 0";
		this.style.cursor = "pointer";
	}
	navItem.obj.onmouseout = function() {
		if (currentItem != this.id) {
			this.style.backgroundPosition = "0 0";
		}
	}
}
if (pageName != "" && pageName != "subnavigation") {
	var thisPage = new getObj("nav-" + pageName);
	if (thisPage.obj.childNodes[1].style.display == "" || thisPage.obj.childNodes[1].style.display == "none") {
		thisPage.style.width = "180px";
		thisPage.style.backgroundPosition = "-30px 0";
		thisPage.obj.childNodes[1].style.display = "block";
		currentItem = "nav-" + pageName;
	}
}
if (subName != "") {
	var thisSubPage = new getObj("sub-" + subName);
	if (subItem == "") {
		thisSubPage.obj.childNodes[0].style.backgroundColor = "#666";
	}
	var hasSubNavs = false;
	for (i = 0; i < thisSubPage.obj.childNodes.length; i++) {
		if (thisSubPage.obj.childNodes[i].nodeType == 1) {
			if (thisSubPage.obj.childNodes[i].nodeName.toLowerCase() == "ul") {
				hasSubNavs = true;
			}
		}
	}
		
	if (hasSubNavs == true) {
		if (thisSubPage.obj.childNodes[1].style.display == "" || thisSubPage.obj.childNodes[1].style.display == "none") {
			thisSubPage.obj.childNodes[1].style.display = "block";
		}
	}
}
if (subItem != "") {
	var thisSubItem = new getObj(subItem);
	if (pageName != "subnavigation") {
		thisSubItem.style.backgroundColor = "#666";
	} else {
		thisSubItem.style.fontWeight = "bold";
	}
}

var anchor;
var anchors;
function externalLinks() {
	if (!document.getElementsByTagName) {
		return;
	}
	anchors = document.getElementsByTagName("a");
	for (i = 0; i < anchors.length; i++) {
		anchor = anchors[i];
		if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") {
			anchor.target = "_blank";
		}
	}
}
externalLinks();