var site = '';
var currQuarter = '262';


function renderAccInvestorRelations() {
	//local code
	//pid=location.href;
//	first=pid.indexOf('_');
//	pid=pid.substr(first+1);
//	pid=pid.split('_');
//	pageID=pid[0];	

//TEAMSITE code
//pageID = location.href;
//pageID = pageID.split('=');
//pageID = pageID[1];
//checkID = pageID.indexOf('#');
//if(checkID != '-1') {pageID = pageID.split('#'); pageID = pageID[0]}
//checkID = pageID.indexOf('&');
//if(checkID != '-1') {pageID = pageID.split('&'); pageID = pageID[0]}

site = '';

if (thomson != '-1') { 
			var thomsonID = location.href; 
			checkURL = thomsonID.indexOf('p='); 
			if(checkURL != '-1') {
				thomsonID = thomsonID.substr(checkURL+2);
				checkAnd = thomsonID.indexOf('&');
				if(checkAnd != '-1') {thomsonID=thomsonID.split('&');thomsonID=thomsonID[0];}
				checkAnc = thomsonID.indexOf('#');
				if(checkAnc != '-1') {thomsonID=thomsonID.split('#');thomsonID=thomsonID[0];}
				//alert(thomsonID);
				pageID = thomsonID;  
				var site = 'http://www.att.com';
			}
		} else if (centralcast == '7') { 
			var pid = 'centralcast';
			var pageID = 'centralcast';
			var site = 'http://www.att.com';
			//alert('centralcast!'); 
		} else {	
			pageID=location.href;
			pageID=pageID.split('=');
			pageID=pageID[1]; 
			checkAnc = pageID.indexOf('#');
			if(checkAnc != '-1') {pageID=pageID.split('#');pageID=pageID[0];
			}
			pageID = pageID.toLowerCase();
			
		}
pageID = pageID.toLowerCase();


	thomson = location.href;
	thomson = thomson.indexOf('phoenix');
	//alert ('Thomson:' + thomson);
	
	stage = location.href;
	stage = stage.indexOf('teamsite.fhstage');
	
	centralcast = location.href;
	centralcast = centralcast.indexOf('att.centralcast');
	//alert('Centralcast:' + centralcast);


//alert('PID:' + pageID);
  





// ANY UPDATES TO THIS SCRIPT NEED TO BE COMPLETED IN THE THOMPSON SCRIPT BELOW!	 

//document.write('<div class="menuButton">PID = ' + pageID + '</div>');
document.write('<div class="menuButton'); if (pageID == "5711") { document.write(' activePage'); } document.write('"><a href="' + site + '/gen/investor-relations?pid=5711" title="Company Information">Company Information</a></div>'
+ '<div class="menuButton'); if (pageID == "5609" || pageID == "7811" || pageID == "7824" || pageID == "9810" || pageID == "7817" || pageID == "7818" || pageID == "9811" || pageID == "9812" || pageID == "7822" || pageID == "5683" || pageID == "9815" || pageID == "9816" || pageID == "22323" || pageID == "22324" || pageID == "9817" || pageID == "7825" || pageID == "5598" || pageID == "5621" || pageID == "5598" || pageID == "5606" || pageID == "5595" || pageID == "5594" || pageID == "5601" || pageID == "5610" || pageID == "5603" || pageID == "5604" || pageID == "5607" || pageID == "5613" || pageID == "7726" || pageID == "7934" || pageID == "9127" || pageID == "5629" || pageID == "18749" || pageID == "18748" || pageID == "5631" || pageID == "18750" || pageID == "18751" || pageID == "5633" || pageID == "18752" || pageID == "18754" || pageID == "5636" || pageID == "18755" || pageID == "18756" || pageID == "18758" || pageID == "5596") { document.write(' activePage'); } document.write('"><a href="' + site + '/gen/investor-relations?pid=5609" title="Corporate Governance">Corporate Governance</a></div>'
+ '<div class="menuButton'); if (pageID == "18777") { document.write(' activePage'); } document.write('"><a href="' + site + '/gen/investor-relations?pid=18777" title="Financial Reporting">Financial Reporting</a></div>');
	if (pageID == '9186' || pageID == '18777' || pageID == '9531' || pageID == '290' || pageID == '262' || pageID == '268' || pageID == '282' || pageID == "irol-sec" || pageID == "irol-sectoc" || pageID == 'irol-sectoc' || pageID == "irol-reportsannual") {
		document.write('<div id="financialMenu" class="menuContent"><div class="menuInner"><ul>'
					+ ' <li'); if (pageID == '290' || pageID == '262' || pageID == '268' || pageID == '282') { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=' + currQuarter + '" title="Quarterly Earnings">Quarterly Earnings</a></li>'
					+ ' <li'); if (pageID == "9186") { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=9186" title="Annual Report">Annual Report</a></li>'
					+ ' <li'); if (pageID == "9531") { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=9531" title="Debt">Debt</a></li>'
					+ ' <li'); if (pageID == "irol-sec" || pageID == 'irol-sectoc' || pageID == "irol-reportsannual") { document.write(' class="activePage"'); } document.write('><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-sec&control_selectgroup=Show%20All" title="SEC Filings">SEC Filings</a></li>'
					+ '</ul></div></div>');
	}
document.write('<div class="menuButton'); if (pageID == "18759") { document.write(' activePage'); } document.write('"><a href="' + site + '/gen/investor-relations?pid=18759" title="Stock Information">Stock Information</a></div>');
	if (pageID == 'centralcast' || pageID == '18759' || pageID == '5675' || pageID == "5673" || pageID == "9510" ||  pageID == "9512" || pageID == "9509" || pageID == "9514" || pageID == "9516" || pageID == "9505" || pageID == "9504" || pageID == "9503" || pageID == "9502" || pageID == "9500" || pageID == "irol-stockquote" || pageID == "irol-stockchart" || pageID == "irol-analysts" || pageID == "irol-stocklookup") {
		document.write('<div id="servicesMenu" class="menuContent"><div class="menuInner"><ul>'
					+ ' <li'); if (pageID == "irol-stockquote") {document.write(' class="activePage"') } document.write('><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-stockQuote" title="Quote">Quote</a></li>'
					+ ' <li'); if (pageID == "irol-stockchart") {document.write(' class="activePage"') } document.write('><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-stockchart" title="Graph">Graph</a></li>'
					+ ' <li'); if (pageID == "5675" || pageID == "9505" || pageID == "9504" || pageID == "9503" || pageID == "9502" || pageID == "9500") { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=5675" title="Historical Dividends">Historical Dividends</a></li>'
					+ ' <li'); if (pageID == "centralcast" || pageID == "irol-stocklookup") { document.write(' class="activePage"'); } document.write('><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-stocklookup" title="Historical Quote">Historical Quote</a></li>'
					+ ' <li'); if (pageID == "5673" || pageID == "9510" || pageID == "9512" || pageID == "9509" || pageID == "9514" || pageID == "9516") { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=5673" title="Historical Splits">Historical Splits</a></li>'
					+ ' <li'); if (pageID == "irol-analysts") {document.write(' class="activePage"') } document.write('><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-analysts" title="Analyst Coverage">Analyst Coverage</a></li>'
					+ '</ul></div></div>');
	}
document.write('<div class="menuButton'); if (pageID == "9533" || pageID == "7503" || pageID == "7504") { document.write(' activePage'); } document.write('"><a href="' + site + '/gen/investor-relations?pid=9533" title="Stockholder Services">Stockholder Services</a></div>');
	if (pageID == '9533' || pageID == '5677' || pageID == '5670' || pageID == '5674' || pageID == '5680' || pageID == '7983' || pageID == '7958' || pageID == '5681' || pageID == '5678' || pageID == '5679' || pageID == '5659' || pageID == '5657' || pageID == '5662' || pageID == '5648' || pageID == '5660' || pageID == '5640' || pageID == '5651' || pageID == '5649' || pageID == '5638' || pageID == '5645' || pageID == '5642' || pageID == '5634' || pageID == '5626' || pageID == '7771' || pageID == '5622' || pageID == '5602' || pageID == '5608' || pageID == '17153' || pageID == '5615' || pageID == '5617' || pageID == '5605' || pageID == '5619' || pageID == '5624' || pageID == '278' || pageID == '8521' || pageID == '7994' || pageID == '7993' || pageID == '5654' || pageID == '5627' || pageID == '5630') {
		document.write('<div id="servicesMenu" class="menuContent"><div class="menuInner"><ul>'
					+ ' <li'); if (pageID == "5677" || pageID == "8521" || pageID == "5670" || pageID == "7994" || pageID == "7993" || pageID == "5674" || pageID == "5680" || pageID == "7983" || pageID == "7958" || pageID == "5681" || pageID == "5678" || pageID == "5679") { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=5677" title="Cost Basis Guide">Cost Basis Guide</a></li>'
					+ ' <li'); if (pageID == "5626" || pageID == "7771") { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=5626" title="Annual Meeting">Annual Meeting</a></li>'
					+ ' <li'); if (pageID == '5659' || pageID == '5657' || pageID == '5662' || pageID == '5648' || pageID == '5660' || pageID == '5640' || pageID == '5651' || pageID == '5649' || pageID == '5638' || pageID == '5645' || pageID == '5642' || pageID == '5634' || pageID == '5627' || pageID == '5630' || pageID == '5622' || pageID == '5602' || pageID == '5608' || pageID == '17153' || pageID == '5615' || pageID == '5617' || pageID == '5605' || pageID == '5619' || pageID == '5624' || pageID == '278' || pageID == '5654') { document.write(' class="activePage"'); } document.write('><a href="' + site + '/gen/investor-relations?pid=5659" title="Stockholder Information">Stockholder Information</a></li>'
					+ ' <li><a href="https://www-us.computershare.com/investor/default.asp?bhjs=1&fla=1&landing=y&issuerid=scusatt&showinvestorcontact=y&ilpt=regplan" title="On-Line Account Access">On-Line Account Access</a></li>'
					+ '</ul></div></div>');
	}
document.write('<div id="stockholderInfoButton" class="menuButton'); if (pageID == "9532" || pageID == "irol-alerts" || pageID == 'irol-alertsconfirm') { document.write(' activePage'); } document.write('"><a href="' + site + '/gen/investor-relations?pid=9532" title="Investor News">Investor News</a></div>'
+ '<div class="menuButton'); if (pageID == 'irol-Guestbook' || pageID == "irol-calendar" || pageID == "irol-guestbook" || pageID == "irol-eventdetails" || pageID == "irol-eventremindersuccess") { document.write(' activePage');}  document.write('"><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-calendar" title="Calendar">Calendar</a></div>'
+ '<div class="menuButton'); if (pageID == "5644" || pageID == "1348") { document.write(' activePage');}  document.write('"><a href="' + site + '/gen/investor-relations?pid=5644" title="Investor Contacts">Investor Contacts</a></div>'
+ '<div class="menuButton'); if (pageID == "irol-faq") { document.write(' activePage');}  document.write('"><a href="http://phx.corporate-ir.net/phoenix.zhtml?c=113088&p=irol-faq" title="FAQ">FAQ</a></div>');


//document.write('<div id="historicalButton" class="menuButton"><a href="' + site + '/gen/investor-relations?pid=5647" title="Events and Presentations">Events and Presentations</a></div>');
//document.write('<div id="annualButton" class="menuButton"><a href="' + site + '/gen/investor-relations?pid=5644" title="Investor Contacts">Investor Contacts</a></div>');
}

function renderAccInvestorRelationsThompson() {
	 renderAccInvestorRelations(); 
}
 

// Absolute Right Accordion for centralcast pages
function renderAccCentralcast() {
		 renderAccInvestorRelations(); 
}

