var FooterTickerBlock = {};

FooterTickerBlock.OverTab = function(oDiv){
	oDiv.style.cursor = 'pointer';	
}

FooterTickerBlock.Click = function(oDiv, SliderType){
	
	if(SelectedFinancialTab == oDiv.id){
		WindowLocation(oDiv.getAttribute('Action'));
	}else{
		var oPreviousSelectedTab = document.getElementById(SelectedFinancialTab);
		oPreviousSelectedTab.className = 'FinancialInformationTab';
		oPreviousSelectedTab.title = oPreviousSelectedTab.getAttribute('DefaultAltText');
		document.getElementById(SelectedFinancialTab+'_IconDiv').style.display = 'none';
		
		oDiv.className = 'FinancialInformationTabSelected';
		oDiv.title = oDiv.getAttribute('AltText');
		document.getElementById(oDiv.id+'_IconDiv').style.display = '';
		SelectedFinancialTab = oDiv.id;
		FooterTickerBlock.ShowIndexInfo(SliderType);
		var LoadingText = document.getElementById('NewsTicker').getAttribute('LoadingText');
		document.getElementById('NewsTicker').innerHTML = '<span class="SystemMessage">'+ LoadingText +'</span>';
	}
}

FooterTickerBlock.ShowIndexInfo = function(SliderType){
	var XmlRequest = new CHttpRequest();
	XmlRequest.RequestFile = "index.php";
	XmlRequest.AddProperty("Action", "0");
	XmlRequest.AddProperty("XmlRequest", "1");
	XmlRequest.AddProperty("RequestedTemplate", "IndexInformation");
	XmlRequest.AddProperty("SliderType", SliderType);
	
	XmlRequest.OnResponse = "FooterTickerBlock.ShowIndexInfoCallback";
	XmlRequest.Send();
	
	return false;
}

FooterTickerBlock.ShowIndexInfoCallback = function(FirstNode, Request){
	var Ticker = Request.responseXML.getElementsByTagName("ticker")[0];
	if(Ticker.textContent != undefined){
		var sHTML = Ticker.textContent;
	}else{
		var sHTML = Ticker.text;
	}
	DropTicker();
	
//	alert(document.getElementById('test123').offsetWidth);
//	document.getElementById('NewsTickerContent').style.width = document.getElementById('test123').offsetWidth;
	document.getElementById('NewsTickerContent').innerHTML = '<span>'+ sHTML +'</span>';
	LoadTicker();

	return true;
}
