function externalLinks() {
 if (!document.getElementsByTagName) return;
 var anchors = document.getElementsByTagName("a");
 for (var i=0; i<anchors.length; i++) {
   var anchor = anchors[i];
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "external") { anchor.target = "_blank";  }
   if (anchor.getAttribute("href") && anchor.getAttribute("rel") == "swfpopup") {
      var popupURL = anchor.getAttribute('href');
      anchor.onkeypress = function(){window.open(this.href, 'PopupWindow', 'toolbar=no,menubar=no,height=400,width=600,location=no,scrollbars=yes,resizable=no,status=no,left=30,top=30'); return false; }
      anchor.onclick = function(){window.open(this.href, 'PopupWindow', 'toolbar=no,menubar=no,height=400,width=600,location=no,scrollbars=yes,resizable=no,status=no,left=30,top=30'); return false; }
      }
   }
}
window.onload = externalLinks;


// DISPLAY OR HIDE CERTAIN ELEMENTS BY ID
function showItem(id) {
	if (!document.getElementById) return;
	obj = document.getElementById(id);
	if(obj) { obj.className = ((obj.className == "shown") ? "hidden" : "shown"); }
}

function showNav(id,parent) {
	if (!document.getElementById) return;
	hideLvl (parent);
	obj = document.getElementById(id);
	if(obj) { obj.className = "shown"; }
}

function hideLvl(parent) {
	switch(parent) {
		case 'Company':
			document.getElementById('Investment').className = "hidden";
			document.getElementById('Agency').className = "hidden";
			document.getElementById('Asset').className = "hidden";
			document.getElementById('Professional').className = "hidden";
		break;
		case 'Properties':
			document.getElementById('Let').className = "hidden";
			document.getElementById('Review').className = "hidden";
			document.getElementById('Let').className = "hidden";
		break;
		default:
			document.getElementById('Company').className = "hidden";
			document.getElementById('Properties').className = "hidden";
			document.getElementById('Retailers').className = "hidden";
	}
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}


function MM_popupMsg(msg) { //v1.0
  alert(msg);
}


