var currentSelectedRowStyle;

function toggleBlock(bId) {
	
	var block = document.getElementById(bId);

	var currDisplay = block.style.display;
	
	if( currDisplay == 'block' ) {
		block.style.display = 'none';
	} else {
		block.style.display = 'block';
	}

	return true;	
}

function showBlock(bId) {
	
	var block = document.getElementById(bId);
	block.style.display = 'block';
	return true;	
}

function hideBlock(bId) {
	
	var block = document.getElementById(bId);
	block.style.display = 'none';
	return true;	
}

function toggleRowClassOver(row, style) {
	currentSelectedRowStyle = row.className;
	if(row.className == 'results-row-odd' || row.className == 'results-row-even'){
		row.className = style;
	}
	return true;

}

function toggleRowClassOut(row) {
	row.className = currentSelectedRowStyle;
	return true;

}

function printBlock(blockName)
{
	if (document.getElementById != null)
	{
		var html = '<HTML>\n<HEAD>\n<link REL=\"stylesheet\" type=\"text/css\" href=\"/styles/print.css\">\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(blockName);
		
		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.");
	}
}

function toggleElementStatus(EId) {
	
	var el = document.getElementById(EId);

	var currStatus = el.disabled;
	
	if( currStatus ) {
		el.disabled = false;
	} else {
		el.disabled = true;
	}
}
