function showCompany(box, info, loc, add)
{
	
	if (document.getElementById)
	{
		if (document.getElementById("content").style)
		{
			document.getElementById("content").style.display='none';
		}
		if (document.getElementById("investorcontent").style)
		{
			document.getElementById("investorcontent").style.display='none';
		}
		if (document.getElementById("chairmancontent").style)
		{
			document.getElementById("chairmancontent").style.display='none';
		}
		
	}
	
	document.getElementById("infocontent").style.display = ''; 
    document.getElementById("mapcontent").style.display = '';
	document.getElementById("marketcontent").style.display='';
	document.getElementById("homedisplay").style.display='';
	
	markCurrentLocation(loc);
	//changeClass(box);
	showInfo(info);	
	showAddress(loc, add);
	
	if (document.lastDot!=null) {
		
		for(var i = 0; i < document.lastDot.length; i++)
		{
			document.lastDot[i].className="invis"; 
			
		}
	} else {
		var arrObj = new Array();
		document.lastDot = arrObj;
	}
	
	var id = box.substring(0, box.length - 3)
	
	
	switch (id)
	{
		case "bernard":
			
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "byars":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "cc":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "csc":			
			document.lastDot[0] = changeDot(id, "1");
			break;		
		case "dltb":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			document.lastDot[3] = changeDot(id, "4");
			break;
		case "dk":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "ec":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "fs":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			break;
		case "ffm":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "holliday":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			break;
		case "mg":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "mrg":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "newmark":
			
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "3");
			document.lastDot[2] = changeDot(id, "4");
			document.lastDot[3] = changeDot(id, "5");
			//document.lastDot[1] = changeDot(id, "2");
			break;
		case "nbs":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			document.lastDot[3] = changeDot(id, "4");
			document.lastDot[4] = changeDot(id, "5");
			document.lastDot[5] = changeDot(id, "7");
			break;
		case "psrs":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			document.lastDot[3] = changeDot(id, "4");
			break;
		case "pfg":
			document.lastDot[0] = changeDot(id, "1");
			//document.lastDot[1] = changeDot(id, "2");
			break;
		case "quantum":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "rhg":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "tdwood":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			document.lastDot[3] = changeDot(id, "4");
			break;
		case "wc":			
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "wec":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "wd":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "tog":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "vpcc":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			document.lastDot[3] = changeDot(id, "4");
			document.lastDot[4] = changeDot(id, "5");
			
			break;
		case "ifc":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "dac":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "arizona":
			document.lastDot[0] = changeDot(id, "5");
			break;
		case "calif":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			document.lastDot[2] = changeDot(id, "3");
			document.lastDot[3] = changeDot(id, "4");
			document.lastDot[4] = changeDot(id, "5");
			document.lastDot[5] = changeDot(id, "6");
			break;
		case "idaho":
			document.lastDot[0] = changeDot(id, "7");
			break;
		case "nevada":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "4");
			break;
		case "mexi":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "newyork":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "oregon":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "2");
			break;
		case "caroli":
			document.lastDot[0] = changeDot(id, "4");
			break;
		case "texas":
			document.lastDot[0] = changeDot(id, "1");
			break;
		case "wash":
			document.lastDot[0] = changeDot(id, "1");
			document.lastDot[1] = changeDot(id, "3");
			document.lastDot[2] = changeDot(id, "5");
			break;	
			
	}
	
}

function markCurrentLocation(loc)
{
	var locRing = findObj("currentLocation");
	locRing.className = "vis"
	var location = findObj(loc.replace(/\BLoc\B/, "Dot"));
	if(location)
	{
		if(document.all)
		{
			locRing.style.pixelTop = parseInt(location.style.pixelTop - 2);
			locRing.style.pixelLeft = parseInt(location.style.pixelLeft - 2);
		} 
		else if(document.getElementById)
		{
			locRing.style.top = parseInt(location.offsetTop - 2);
			locRing.style.left = parseInt(location.offsetLeft - 2);
		}
	} 
}

function changeDot(id, num)
{
	
	var obj = findObj(id + "Dot" + num);
	//alert(obj + id + num);
	obj.className = "vis";
	return obj;
}

function changeClass(obj)
{
	if (document.tmpObj!=null) document.tmpObj.className="companyWrapper"; 
	objRef = findObj(obj);
	objRef.className =  "companyWrapperActive";	
	document.tmpObj = objRef;
}

function showInfo(div)
{
	if (document.lastShown!=null) document.lastShown.className="companyInfoHidden"; 
	var objRef = findObj(div);
	objRef.className = "companyInfoShown";	
	document.lastShown = objRef;
}


function showAddress(span,div)
{
	if (document.lastAddress!=null) {
		document.lastAddress[0].className="notSelected"; 
		document.lastAddress[1].className="companyAddHidden"; 
		//alert("test");
	} else {
		var arrObj = new Array();
		document.lastAddress = arrObj;
		//alert("notTest");
	}
	var spanRef = findObj(span);
	var divRef = findObj(div);
	// alert(spanRef.className);
	// alert(divRef.className);
	spanRef.className = "selected";
	divRef.className = "companyAddShown";
	
	document.lastAddress[0] = spanRef;
	document.lastAddress[1] = divRef;
	//alert(divRef.className);
	//alert(spanRef.className);
}

function findObj(obj, d){
	var found;
	if (!d) d = document;
	
	// for IE
	if (!(found=d[obj]) && d.all) found = d.all[obj];
	
	// for DOM compliant
	if (!found && document.getElementById) found = document.getElementById(obj); 
	// for old NN
	
	for (i=0; !found && i < d.forms.length; i++) found = d.forms[i][obj]; 
	for (i=0; !found && d.layers && i < d.layers.length; i++) found = findObj(obj,d.layers[i].document);
	return found;	
}


function changeInvestorDiv()    
{        
	var divstyle = new String();        
	divstyle = document.getElementById("investorcontent").style.visibility ;  		
	if(divstyle.toLowerCase()=="visible" || divstyle == "")        
	{           
		document.getElementById("investorcontent").style.display = ''; 
		document.getElementById("content").style.display = 'none'; 
		document.getElementById("infocontent").style.display = 'none'; 
		document.getElementById("mapcontent").style.display = 'none'; 
		document.getElementById("chairmancontent").style.display='none';
		document.getElementById("marketcontent").style.display='none';
		document.getElementById("homedisplay").style.display='';	    
	}        
	
}

function changeChairmanDiv()    
{        
	var divstyle = new String();        
	divstyle = document.getElementById("chairmancontent").style.visibility ;   
	if(divstyle.toLowerCase()=="visible" || divstyle == "")        
	{           
		document.getElementById("chairmancontent").style.display = ''; 
		document.getElementById("content").style.display = 'none'; 
		document.getElementById("infocontent").style.display = 'none'; 
		document.getElementById("mapcontent").style.display = 'none'; 
		document.getElementById("investorcontent").style.display='none';
		document.getElementById("marketcontent").style.display='none';
		document.getElementById("homedisplay").style.display='';	    
	}        
	
}

