tabs = [{}, {top:30,left:75,href:'/home'}, {top:35,left:173,href:'/whatwedo'}, {top:35,left:280,href:'/bios'}, {top:30,left:388,href:'/clients'}, {top:30,left:485,href:'/intheworks'}, {top:30,left:585,href:'/contact'}]

stopUnhighlight = false;
var clearHiglightTimer;
var defaultTab;

function underlineMouseOver() {
	stopUnhighlight = true;
}

function underlineMouseOut() {
	stopUnhighlight = false;
}

function tabHighlight(tabNumber) {
	if(typeof tabNumber == "undefined") {
		tabNumber = 1;
//		alert(tabNumber);
	}
	
	if(typeof clearHighlightTimer != "undefined")
		clearTimeout(clearHighlightTimer);
	
	if(!stopUnhighlight) {
		var navimgpos = findPos(document.getElementById('navImage'));
		var baseleft = navimgpos[0];
		var basetop = navimgpos[1];
		
		var uline = document.getElementById('tabUnderline');
		uline.style.display='inline';
		uline.style.position='absolute';
		uline.style.top=(basetop + tabs[tabNumber].top) + 'px';
		uline.style.left=(baseleft  + tabs[tabNumber].left) + 'px';
		
		document.getElementById('tabUnderlineLink').href = tabs[tabNumber].href;
	}
}

function tabNoHighlight() {
	if(stopUnhighlight)
		document.getElementById('tabUnderline').style.display='none';
}

function findPos(obj) {
	var curleft = curtop = 0;

	if (obj.offsetParent) {
		do {
			curleft += obj.offsetLeft;
			curtop += obj.offsetTop;
		} while (obj = obj.offsetParent);
		return [curleft,curtop];
	} else {
		return [-1,-1];
	}
}

