/* For Index Performance pages */
function resizeGuts() {
	if(document.getElementById && !(document.all)) {
		h = document.getElementById('guts').contentDocument.body.scrollHeight;
		w = document.getElementById('guts').contentDocument.body.scrollWidth;
		document.getElementById('guts').style.height = h + 50;
		//document.getElementById('guts').style.width = w + 20;
	}
	else if(document.all) {
		h = document.frames('guts').document.body.scrollHeight;
		w = document.frames('guts').document.body.scrollWidth;
		document.all.guts.style.height = h + 50;
		//document.all.guts.style.width = w + 20;
		}
}
 

/* For Activia Live Chat */
function loadALC() {
 var alc = document.getElementById('alc');
 if(getCookie('AuthToken')) { // this will be set by Pan Server if the user is logged in
		alc.src='/alc/chat.html';
	}
}


// Flag for whether or not to automatically call the print function
var gAutoPrint = true;

/* For Print This Page */
function printElement( pId )
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n\n';

		html += '\n</HE' + 'AD>\n<BODY>\n';
		var table = '\n<table>\n<tr><td><img src=\"/images/MSCIBarralogoSm.gif\" width=\"135\" height=\"35\"></td><tr></table>';
		
		//Add the table to the html
		html += table;
		
		var printBodyElem = document.getElementById( pId );
		
		if (printBodyElem != null)
		{
				html += printBodyElem.innerHTML;
		}
		else
		{
			alert("Could not find the section in the HTML to print. Please use the browsers print option.");
			return;
		}
			
		html += '\n</BO' + 'DY>\n</HT' + 'ML>';
		
		var printWin = window.open("","printSpecial");
		printWin.document.open();
		printWin.document.write(html);
		printWin.document.close();
		if (gAutoPrint)
			printWin.print();
	}
	else
	{
		alert("Sorry, the print ready feature is only available in modern browsers.");
	}
}