function bcfn_CheckDomain() {
	var d = bcfn_GetDomain();
	if ((d == 'barchart') || (d == 'theenergydesk'))
		return true;
	else
		return false;
}

function bcfn_GetDomain() {
	var s = document.domain;
	s = s.toLowerCase();
	if (s.substring(0, 7) == 'http://') {
		s = s.substring(7);
	}

	var ary1 = s.split('/');
	var ary2 = ary1[0].split('.');

	var d = '';

	if ((ary2[ary2.length - 1] == 'com') || (ary2[ary2.length - 1] == 'org') || (ary2[ary2.length - 1] == 'net') || (ary2[ary2.length - 1] == 'edu') || (ary2[ary2.length - 1] == 'gov')) {
		if (ary2.length > 1)
			d = ary2[ary2.length - 2];
	}
	else {
		if (ary2.length > 2)
			d = ary2[ary2.length - 3];
	}

	return d;
}


function bcfn_GetColor(s) {
	var c = s.substring(0, 1);
	if (c == '+')
		return '#008800';
	else if (c == '-')
		return '#FF9D30';
	else
		return '#0000FF';
}

if (bcfn_CheckDomain()) {
document.write('<div class="bcCon"><div class="bcBan"><table border="0" cellpadding="0" cellspacing="0">');
document.write('<tr><td class="bcTD2" width="300" height="30"><b>Delayed Futures Prices</b></td>');
function OpenChart(sym) {var u = 'http://sites2.barchart.com/pl/tfs/chart2.htx?sym=' + sym + '&data=Z30&late=y&mode=i&jav=adv'; window.open(u, 'popup', 'scrollbar=true,width=614,height=450'); } function openSymbol(symbol) { OpenChart(symbol); }document.write('<td width="310"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td class="bcTD" width="40%" nowrap="nowrap"><b><span style="border: 1px solid #666666; font-size: 7pt; text-align: center; font-weight: bold;"><A HREF=# onclick=openSymbol("CLX8") class=bcQLink onMouseOver="return true;" style="text-decoration: none;">C</A></span>&nbsp;Crude Oil</b></td>');
document.write('<td class="bcTD" align="left" width="25%"><font color="' + bcfn_GetColor('-5.00') + '"><b>-5.00</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>88.88</b></td></table></td>');
document.write('<td width="310"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td class="bcTD" width="40%" nowrap="nowrap"><b><span style="border: 1px solid #666666; font-size: 7pt; text-align: center; font-weight: bold;"><A HREF=# onclick=openSymbol("NGX8") class=bcQLink onMouseOver="return true;" style="text-decoration: none;">C</A></span>&nbsp;Natural Gas</b></td>');
document.write('<td class="bcTD" align="left" width="25%"><font color="' + bcfn_GetColor('-0.449') + '"><b>-0.449</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>6.909</b></td></table></td>');
document.write('<td width="310"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td class="bcTD" width="40%" nowrap="nowrap"><b><span style="border: 1px solid #666666; font-size: 7pt; text-align: center; font-weight: bold;"><A HREF=# onclick=openSymbol("SPZ8") class=bcQLink onMouseOver="return true;" style="text-decoration: none;">C</A></span>&nbsp;S&P 500</b></td>');
document.write('<td class="bcTD" align="left" width="25%"><font color="' + bcfn_GetColor('-3.20') + '"><b>-3.20</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>1050.10</b></td></table></td>');
document.write('</tr><tr><td class="bcTD"><b>Oct. 6 6:31 p.m. EDT</b></td>');
document.write('<td width="310"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td class="bcTD" width="40%" nowrap="nowrap"><b><span style="border: 1px solid #666666; font-size: 7pt; text-align: center; font-weight: bold;"><A HREF=# onclick=openSymbol("HOX8") class=bcQLink onMouseOver="return true;" style="text-decoration: none;">C</A></span>&nbsp;Heating Oil</b></td>');
document.write('<td class="bcTD" align="left" width="25%"><font color="' + bcfn_GetColor('-0.1496') + '"><b>-0.1496</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>2.5124</b></td></table></td>');
document.write('<td width="310"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td class="bcTD" width="40%" nowrap="nowrap"><b><span style="border: 1px solid #666666; font-size: 7pt; text-align: center; font-weight: bold;"><A HREF=# onclick=openSymbol("RBX8") class=bcQLink onMouseOver="return true;" style="text-decoration: none;">C</A></span>&nbsp;RBOB</b></td>');
document.write('<td class="bcTD" align="left" width="25%"><font color="' + bcfn_GetColor('-0.1443') + '"><b>-0.1443</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>2.0840</b></td></table></td>');
document.write('<td width="310"><table cellpadding="0" cellspacing="0" border="0" width="100%"><td class="bcTD" width="40%" nowrap="nowrap"><b><span style="border: 1px solid #666666; font-size: 7pt; text-align: center; font-weight: bold;"><A HREF=# onclick=openSymbol("NDZ8") class=bcQLink onMouseOver="return true;" style="text-decoration: none;">C</A></span>&nbsp;NASDAQ</b></td>');
document.write('<td class="bcTD" align="left" width="25%"><font color="' + bcfn_GetColor('+3.50') + '"><b>+3.50</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>1410.00</b></td></table></td>');
document.write('</tr>');
document.write('</table></div></div>');
}
