//alert('AC.LifeStation.TextSizeCtl.js: Loading template'); //!!!DEBUG
//var _S_RUN = false;
document.write("\
<style type=\"text/css\">\
  @media screen\
  {\
	.TSCtl\
	{\
		display: none;\
	}\
	.TSCtlHeader\
	{\
		vertical-align: middle;\
		font-family: Arial, Helvetica, sans-serif;\
		font-size: 12px;\
		color: #3576a3;\
		padding: 0 7px 0 0;\
	}\
	.TSCtl a\
	{\
		border: 1px solid #a0a0a0;\
		font-family: Lucida Console, monospace;\
		text-decoration: none;\
		color: #3576a3;\
		margin: 2px;\
	}\
	.TSCtl a.current, .TSCtl a:hover\
	{\
		background-color: silver;\
		border: 1px solid #a0a0a0;\
	}\
  }\
  @media print {.TSCtl { display: none; } }\
</style>\
<div class=\"TSCtl\" id=\"TSCtlTemplate\"><span class=\"TSCtlHeader\">Text Size</span\
        		><a href=\"#\" class=\"TSCtlButton\" style=\"font-size: 10px; padding: 6px 7px 2px 7px;\" onclick=\"this.blur(); return false;\">A</a\
        		><a href=\"#\" class=\"TSCtlButton\" style=\"font-size: 16px; padding: 1px 5px 1px 5px;\" onclick=\"this.blur(); return false;\">A</a\
        		><a href=\"#\" class=\"TSCtlButton\" style=\"font-size: 18px; padding: 0 4px 0 4px;\" onclick=\"this.blur(); return false;\">A</a></div>");
//alert('AC.LifeStation.TextSizeCtl.js: Loading namespace');  //!!!DEBUG
if(typeof(AC) != 'object')
	var AC = new Object();
if(typeof(AC.LifeStation) != 'object')
	AC.LifeStation = new Object();
if(typeof(AC.LifeStation.TextSizeCtl) != 'function')
{
	AC.LifeStation.TextSizeCtl = function()
	{
		//alert('AC.LifeStation.TextSizeCtl()');  //!!!DEBUG
		var TextSizeCtl = document.getElementById('TSCtlTemplate').cloneNode(true);
		TextSizeCtl.style.display = 'block';
		TextSizeCtl.id = '';

		TextSizeCtl.RegisterStyleHolder = function(StyleHolderID)
		{
			this.StyleHolder = document.getElementById(StyleHolderID);
		}

		TextSizeCtl.StyleList = new Array();
		TextSizeCtl.RegisterStyle = function(position, StyleURL)
		{
			if(position < 0 || position > 3)
				throw 'Style position out of range 0-3: '+position;
			TextSizeCtl.StyleList[position] = StyleURL;
		}

		TextSizeCtl.LoadStyle = function(position)
		{
			if(typeof(this.CurrentPosition) == 'number')
			{
				this.Buttons[this.CurrentPosition].className = '';
				//this.rows[this.CurrentPosition].cells[0].firstChild.disabled = false;
				//var s = this.rows[this.CurrentPosition].cells[0].firstChild.style;
				//s.backgroundColor = 'white';
				//s.hover.backgroundColor = 'silver';
			}
			if(typeof(this.OnLoadStyleDelegate) == 'object' && typeof(this.OnLoadStyleDelegate.call) == 'function')
				this.OnLoadStyleDelegate.call(position);
			var StyleUrl = this.StyleList[position];
			if(StyleUrl == null)
				this.StyleHolder.disabled = true;
			else
			{
				this.StyleHolder.disabled = false;
				if(this.StyleHolder.href != StyleUrl)
					this.StyleHolder.href = StyleUrl;
			}
			this.CurrentPosition = position;
			//this.rows[this.CurrentPosition].cells[0].firstChild.style.backgroundColor = 'silver';
			this.Buttons[this.CurrentPosition].className = 'current';
			//this.rows[this.CurrentPosition].cells[0].firstChild.disabled = true;
			return false;
		}
		
		TextSizeCtl.Buttons = Array();
		TextSizeCtl.HandleClick = function(style_no)
		{

			this.LoadStyle(style_no); 
			//_s_action('0'+(6+style_no).toString()); //Feb 22, 2007: AlexB: Action 6, 7 and 8 are combined together as per Igor's request
			var snstr = style_no.toString();
			if(typeof(_s_action) == 'function') //Apr 23, 2007: AlexB: check added because indextools.js might not be included on the development
				_s_action('06', 'xaParam'+snstr, 'ocParam'+snstr, 'xdParam'+snstr, 'xtParam'+snstr, 'xsParam'+snstr);
			return false;
		}

		var row;
		var lnk;
		
		lnk = TextSizeCtl.childNodes[1];
		lnk.TextSizeCtl = TextSizeCtl;
		lnk.onclick = function(){this.blur(); return this.TextSizeCtl.HandleClick(0);}
		TextSizeCtl.Buttons[0] = lnk;

		lnk = TextSizeCtl.childNodes[2];
		lnk.TextSizeCtl = TextSizeCtl;
		lnk.onclick = function(){this.blur(); return this.TextSizeCtl.HandleClick(1);}
		TextSizeCtl.Buttons[1] = lnk;

		lnk = TextSizeCtl.childNodes[3];
		lnk.TextSizeCtl = TextSizeCtl;
		lnk.onclick = function(){this.blur(); return this.TextSizeCtl.HandleClick(2);}
		TextSizeCtl.Buttons[2] = lnk;

		return TextSizeCtl;
	}
}