function showSub(which) {
	clearAllSubs();
	if (which != 'none') {
		whichNav = which + 'Sub';
		if (document.getElementById('listingsInput')) {
			 document.getElementById('listingsInput').style.display = none;
		}
		toShow = document.getElementById(whichNav);
		toShow.style.display = 'block';
	}
}

function clearAllSubs() {
	document.getElementById('aboutSub').style.display = 'none';
	document.getElementById('servicesSub').style.display = 'none';
	if (document.getElementById('listingsInput')) {
		 document.getElementById('listingsInput').style.display = inline;
	}
}

function swapImage (img,width,height) {
    var target = document.getElementById('largePhoto');
    target.src = img;
    target.width = width;
    target.height = height;
}

function swapImage (img) {
    var target = document.getElementById('largePhoto');
    target.src = img;
}

function tableSelect (id) {
	blurAllFields();
	toHighlight = document.getElementById(id);
	toHighlight.className = "highlighted";
}

function blurAllFields () {
	if (document.contactForm) {
		thetable = document.getElementById('contactTable');
		for (x=0;x<thetable.length;x++) {
			thetable[x].className = "noHighlight";
		}
	}
}

function CreateWindow(theURL)
{
	var hWind=null
	hWind=window.open(theURL,"popup","menubar=1, scrollbars=1, resizable=1, width=500, height=600");
	hWind.focus()
}

function showSubMenu(which) {
	hideSubMenus();
	toShow = document.getElementById(which);
	toShow.style.display = 'block';
}

function hideSubMenus() {
	if (document.getElementById('Agent')) {
		toHide = document.getElementById('Agent');
		toHide.style.display = 'none';
	}
	if (document.getElementById('SeniorManagement')) {
		toHide = document.getElementById('SeniorManagement');
		toHide.style.display = 'none';
	}
	if (document.getElementById('Principal')) {
		toHide = document.getElementById('Principal');
		toHide.style.display = 'none';
	}
}

