﻿/* Added by IJS for offline contracts August 2008 */

ss = document.styleSheets;
ssLength = ss.length;

if(navigator.appName == "Microsoft Internet Explorer")
{
	for(i = 0; i < ssLength; i++)
	{
		for(j = 0; j < ss[i].rules.length; j++)
		{
			if(ss[i].cssText.match("blue"))
			{
				bg = "#D4DBE7";
			}
			if(ss[i].cssText.match("brown"))
			{
				bg = "#E4E3DD";
			}
			if(ss[i].cssText.match("green"))
			{
				bg = "#CCE2E6";
			}
			if(ss[i].cssText.match("lime"))
			{
				bg = "#E6EEC8";
			}
			if(ss[i].cssText.match("silver"))
			{
				bg = "#D4E0E8";
			}
		}
	}
}
else
{
	for(i = 0; i < ssLength; i++)
	{
		for(j = 0; j < ss[i].cssRules.length; j++)
		{
			if(ss[i].cssRules[j].cssText.match("blue"))
			{
				bg = "#D4DBE7";
			}
			if(ss[i].cssRules[j].cssText.match("brown"))
			{
				bg = "#E4E3DD";
			}
			if(ss[i].cssRules[j].cssText.match("green"))
			{
				bg = "#CCE2E6";
			}
			if(ss[i].cssRules[j].cssText.match("lime"))
			{
				bg = "#E6EEC8";
			}
			if(ss[i].cssRules[j].cssText.match("silver"))
			{
				bg = "#D4E0E8";
			}
		}
	}
}

//get the page URL and take the substring after the ?
qsFull = window.location.search.substring(1);
//split the substring based on the location of the =
qsValue = qsFull.split("=");
cType = qsValue[1];
//check on the value of querystring parameter and write the appropriate headline
if(cType == "yes")
{
	document.title = "Offline Futures Trading Rates";
	document.getElementById('contractsHeadline').innerHTML = "Offline Futures Contract Specifications";
	document.getElementById('contractsTypeRight').style.backgroundColor = bg;}
else
{
	document.title = "Online Futures Trading Rates";
	document.getElementById('contractsHeadline').innerHTML = "Online Futures Contract Specifications";
	document.getElementById('contractsTypeLeft').style.backgroundColor = bg;
}