
function LoadBranding()
{
	var rules = document.styleSheets[0].rules;
	var i;
	for(i=0; i<rules.length; i++)
	{
		nm = rules[i].selectorText.toLowerCase();
		if(nm.substring(0,6)=='brand#') if(nm.indexOf('active')>=0) break;
	}
	if(i>=rules.length) i=0;
	
	Branding = new objBranding(rules[i].style);
}		

function objBranding(styleobj)
{
	var m_style = styleobj;

	this.style = m_style;
	
	this.Bool = _Bool;
	this.Text = _Text;
	this.Value = _Value;

	function _Bool(flagName) { var tv = _Text(flagName); switch(tv) { case "": case "0": case "false": return false; } return new Boolean(tv); } 
	function _Text(flagName)    { return (m_style[flagName]==undefined) ? "" : m_style[flagName]; }
	function _Value(flagName)     { return parseInt(m_style[flagName]); }
}

var Branding = null;

LoadBranding();

