/**
The taubman.js file is built by SMARTBridge Design team to facilitate some functions to be used in building the Taubman Website.
 */ 
function chk_divs()
{	var divSitenav_height, divWrapper_height;
	var fxHeight = 65;
	var newFtrPos, defaultFtrPos;
	
	defaultFtrPos = 397;
	defaultLeftBannerPos = 40;
	subtr = 10;

	divSitenav_height = document.getElementById("sitenav").offsetHeight;	
	divWrapper_height = fxHeight + divSitenav_height
	
	if(divWrapper_height < 290) 
	{
		document.getElementById("wrapperHome").style.height = '410px';
		document.getElementById("footer").style.top = defaultFtrPos + 'px';
		document.getElementById("banner_left").style.top = '260px';
	}
	else
	{
		newFtrPos = fxHeight + divSitenav_height + 130
		document.getElementById("wrapperHome").style.height = newFtrPos + 'px';
		document.getElementById("footer").style.top = defaultFtrPos + (newFtrPos - defaultFtrPos - subtr) + 'px';
		document.getElementById("banner_left").style.top = defaultLeftBannerPos + (newFtrPos - 190) + 'px';
	}	
}

/* function to get url from drop-down menu*/
function selecturl(s) 
{
  var geturl = s.options[s.selectedIndex].value;
  if ((geturl != null) && (geturl != "") )
  {
    window.top.location.href = geturl;
  }
}

/* function to show and hide DIVs (Executive Profiles Page)*/
function show(id)
{

for (var i=1;(obj=document.getElementById("ProfileContent_div" + i));i++)
{
	if (obj.id!="ProfileContent_div"+id) 
	{
	obj.style.display='none';
	}	

	if (obj.id=="ProfileContent_div"+id)
	{
	 obj.style.display='block';
	document.getElementById("ExecutiveDiv"+id).style.border='1px solid #3579C9';
	}
	}
	for (var i=1;(obj=document.getElementById("ExecutiveDiv" + i));i++)
	{
	if (obj.id!="ExecutiveDiv"+id) 
	{
	obj.style.border = 'none';
	}
	}
}

<!--    Script to Open Pop's and Div Hideing/Showing     -->

function committeeDetails_PopUp(name)
{
window.open(name + "_committeedetails_popup.html","PopMap",'location=0,status=0,scrollbars=0 , toolbar=no ,width=500,height=300, top=175, left=290,screenX=300,screenY=180');
}

function directors_PopUp(name)
{
window.open(name + "_directors_popup.html","PopMap",'location=0,status=0,scrollbars=0 , toolbar=no ,width=500,height=300, top=175, left=290,screenX=300,screenY=180');
}




function expandCollapseMenu(idx)
{
    for (var i=1;i < 10;i++)
    {
        if(obj = document.getElementById("SHD" + i) ) 
        {
            if (obj.id!="SHD"+idx) obj.style.display='none';
            if (obj.id=="SHD"+idx) obj.style.display='block';
        }
    }
}


/* ----Navigation Menu-----*/
function change(paramId,paramTxt)
{ 
	//alert('paramId,paramTxt:' + paramId + "," + paramTxt);

	var obj,aTags,i,parentTag,parentOfparent;
	var cInfo, sLea, cGov, fInfo	

	cInfo = document.getElementById('centerInfo');
	sLea = document.getElementById('specialityLeasing');		
	cGov = document.getElementById('corpGovernance');
	fInfo = document.getElementById('finanInfo');

	if(paramId == "" && paramTxt == "")
	{
		cInfo.innerHTML = cInfo.innerHTML.replace("- ","+ ");

		sLea.innerHTML = sLea.innerHTML.replace("- ","+ ");
	
		cGov.innerHTML = cGov.innerHTML.replace("- ","+ ");
	
		fInfo.innerHTML = fInfo.innerHTML.replace("- ","+ ");
	
	}
	else
	{
		obj = document.getElementById(paramId);

		parentTag = obj.parentNode;
		parentOfparent = parentTag.parentNode;

		if(parentOfparent.className == "expanded")
		{
			obj.innerHTML = obj.innerHTML.replace("+ ","- ");
		}
		else
		{
			obj.innerHTML = obj.innerHTML.replace("- ","+ "); 
		}

		aTags = document.getElementsByTagName('a');

		for (i = aTags.length; i != 0; i--)
		{ 
			if( (aTags[i-1].id != paramId && aTags[i-1].innerHTML.indexOf("-")!= -1) && ( paramId == cInfo.id || paramId == sLea.id || paramId == cGov.id || paramId == fInfo.id ) )
			{ 
				aTags[i-1].innerHTML = aTags[i-1].innerHTML.replace("- ","+ ");
			}
		}
	}
}

function InvestorRel_show(yearId)
{
	for (var i=1;(yrID = document.getElementById("filings" + i));i++) 
	{
		if (yrID.id != "filings" + yearId )
		{
			yrID.style.display='none';
			document.getElementById("arrow" + i).src = "/images/arr1.gif";
		}
		else
		{
		 yrID.style.display='block';
		document.getElementById("arrow" + i).src = "/images/arr2.gif";
		}		
	}	
}


function InvestorRel2_show(id)
{
	for (var i=1;(obj=document.getElementById("filings" + i));i++)
	{
		if (obj.id=="filings"+id && obj.style.display == "none")
		{
		 obj.style.display='block';
		 document.getElementById("arrow" + i).src = "/images/arr2.gif";
		}
		else
		{
		 obj.style.display='none';
		 document.getElementById("arrow" + i).src = "/images/arr1.gif";
		}
	}
}

function showPressRelYr(paramId)
{
	obj1 = document.getElementById("year" + paramId);
	
	for (var i=1;(obj = document.getElementById("year" + i));i++)
	{
		if (obj1.id != obj.id) 
		{
			obj.style.display='none';			
			document.getElementById("yr" + i).className = "cursorTD";
		}	
		else
		{
			obj1.style.display='block';
			document.getElementById("yr" + i).className = "cursorTDBld";
		}
	}	
}

function NewWindow(page) {
OpenWin = this.open(page, "CtrlWindow", "toolbar=yes,menubar=yes,location=yes,scrollbars=yes,resizable=yes");
}