function bcfn_CheckDomain() {
	var d = bcfn_GetDomain();
	if ((d == 'barchart') || (d == 'theenergydesk') || (d == '184'))
		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] == '23') || (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("CLQ9") 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('-0.28') + '"><b>-0.28</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>66.45</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("NGQ9") 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.048') + '"><b>+0.048</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>3.663</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("SPU9") 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('+1.80') + '"><b>+1.80</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>895.10</b></td></table></td>');
document.write('</tr><tr><td class="bcTD"><b>Jul. 2 11:35 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("HOQ9") 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.0028') + '"><b>-0.0028</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>1.6988</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("RBQ9") 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.0130') + '"><b>-0.0130</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>1.7778</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("NDU9") 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('+2.25') + '"><b>+2.25</b></font></td>');
document.write('<td class="bcTD" align="left" width="35%" height="30"><b>1447.50</b></td></table></td>');
document.write('</tr>');
document.write('</table></div></div>');
}
else { document.write('Unauthorized access!'); }
