function handleError (err, url, line) {
	if (err.indexOf('bject') != -1) {
		return true; // error is handled
	} else {
		return false; // let the browser handle the error
	}
}
window.onerror = handleError;

var cellHeight = 20;
var leadingCharacter = ' &nbsp;';
var submenuCharacter = '&nbsp;&nbsp;&nbsp;»';
var id = 1;

No3 = (parseInt(navigator.appVersion) > 3) ? 1:0;
layer = 'document.getElementById(\'L\'+menu).style';
var timer;

//Get the img X and Y positions with an onMouseOver event
function getDim(el){
	for (var lx=0,ly=0;el!=null;
		lx+=el.offsetLeft,ly+=el.offsetTop,el=el.offsetParent);
	return {x:lx,y:ly}
}

var xcoord = new Array();
var ycoord = new Array();
xcoord[xcoord.length] = getDim(document.getElementById("menu_span1")).x+(-110);
ycoord[ycoord.length] = getDim(document.getElementById("menu_span1")).y+(1);
xcoord[xcoord.length] = getDim(document.getElementById("menu_span2")).x+(-110);
ycoord[ycoord.length] = getDim(document.getElementById("menu_span2")).y+(1);
xcoord[xcoord.length] = getDim(document.getElementById("menu_span3")).x+(-110);
ycoord[ycoord.length] = getDim(document.getElementById("menu_span3")).y+(1);
xcoord[xcoord.length] = getDim(document.getElementById("menu_span4")).x+(-110);
ycoord[ycoord.length] = getDim(document.getElementById("menu_span4")).y+(1);
xcoord[xcoord.length] = getDim(document.getElementById("menu_span5")).x+(-110);
ycoord[ycoord.length] = getDim(document.getElementById("menu_span5")).y+(1);

function LayerSpecs(Left,Top,Width) { 
	if(No3) {
		this.left  = Left;
		this.top   = Top;
		this.info  = '';
		var t = Top;
		
		this.info += '<table class="tweditor_dropdown_container" cellpadding="0" cellspacing="0">';
		this.info += '<tr>';
		this.info += '<td>';
		this.info += '<table cellpadding="0" cellspacing="0">';
		
		for(i=3; i<arguments.length; i++) {
			this.info += '<tr>';
			this.info += '<td class="tweditor_dropdown" onMouseOver="this.className=\'tweditor_dropdown_over\';" onMouseOut="this.className=\'tweditor_dropdown\';">';
			this.info += '<a href="'+arguments[i++]+'">'+arguments[i]+'</a>';
			this.info += '</td>';
			this.info += '</tr>';
			t = t + 20;
		}
		this.info += '</table>';
		this.info += '</td>';
		this.info += '</tr>';
		this.info += '</table>';
		id += 1;
	} 
}

var path;
if (window.location.href.indexOf('/pages/')>-1) {
	path = '../';
	if (window.location.href.indexOf('/people/')>-1) {
		path += '../';
	}
} else {
	path = '';
}

Layer = new Array();
Layer[1] = new LayerSpecs(xcoord[0],ycoord[0],160,path+'pages/why.html" onMouseOver="Show(1);',leadingCharacter+'Why C3',path+'pages/say.html" onMouseOver="Show(1);',leadingCharacter+'What Our Clients Say');
Layer[2] = new LayerSpecs(xcoord[1],ycoord[1],160,'','');
Layer[3] = new LayerSpecs(xcoord[2],ycoord[2],160,
path+'pages/team.html" onMouseOver="Show(3);',leadingCharacter+'The Team',
path+'pages/people/lapidus.html" onMouseOver="Show(3);',leadingCharacter+'Todd Lapidus',
path+'pages/people/lee.html" onMouseOver="Show(3);',leadingCharacter+'Sherry Lee',
path+'pages/people/clancy.html" onMouseOver="Show(3);',leadingCharacter+'Tom Clancy',
path+'pages/people/garling.html" onMouseOver="Show(3);',leadingCharacter+'Wendy Garling',
path+'pages/people/payton.html" onMouseOver="Show(3);',leadingCharacter+'Kim Payton',
path+'pages/people/levers.html" onMouseOver="Show(3);',leadingCharacter+'Robert Levers',
path+'pages/people/peterson.html" onMouseOver="Show(3);',leadingCharacter+'Gordon Peterson',
path+'pages/people/mcohen.html" onMouseOver="Show(3);',leadingCharacter+'Matt Cohen');
Layer[4] = new LayerSpecs(xcoord[3],ycoord[3],160,path+'pages/projects.html" onMouseOver="Show(4);',leadingCharacter+'Projects',path+'pages/clients.html" onMouseOver="Show(4);',leadingCharacter+'Clients');
Layer[5] = new LayerSpecs(xcoord[4],ycoord[4],160,'','');
Layer[6] = new LayerSpecs(xcoord[5],ycoord[5],160,'','');
Layer[7] = new LayerSpecs(xcoord[6],ycoord[6],160,'','');


j = (Layer[0]) ? 0:1;

for(i=j; i<Layer.length; i++) {
	document.write('<span onMouseOver="clearTimeout(timer);" onMouseOut="Hide('+i+')" id="L'+i+'" style="position:absolute; visibility:hidden; top:'+Layer[i].top+'; left:'+Layer[i].left+';">'+Layer[i].info+'</span>');
}

function Show() { 
	if(layer){
		if(timer) clearTimeout(timer);
		
		for(menu=0; menu<Layer.length; menu++) {
			if(Layer[menu]) { 
				eval(layer).visibility = 'hidden'; 
			} 
		}
		
		for(i=0; i<arguments.length; i++) { 
			menu=arguments[i]; eval(layer).visibility = 'visible'; 
		}
	}
}

function Hide(){ 
	timer = setTimeout('Show()', 200); 
}