function callBackGetStat(iResponse)
{
	if (iResponse.status == ERROR_NO_FAULT)
	{
		var		stat = '';

		for (var a = 0; a < iResponse.object.result.length; a++)
		{
			stat += '<b>' + iResponse.object.result[a].text + ' (' + iResponse.object.result[a].percent + '%)</b><br />';
			if (iResponse.object.result[a].width != 0)
			{
				stat += '<div class="statbar" style="width:' + iResponse.object.result[a].width + 'px;"></div><br />';
			}
			else
			{
				stat += 'No results<br /><br />';
			}
		}
		document.getElementById('statframe').style.display = 'block';
		document.getElementById('stat').innerHTML = stat;
	}
	else
	{
		alert(iResponse.msg);
	}
}

function getStatistics(iDate)
{
	getDefaultStat(iDate,500,callBackGetStat);
}

function callBackGetExtStat(iResponse)
{
	if (iResponse.status == ERROR_NO_FAULT)
	{
		var		stat = '';

		for (var a = 0; a < iResponse.object.answer.length; a++)
		{
			stat += '<b>' + iResponse.object.answer[a].text + '</b><br />';
			if (iResponse.object.answer[a].result.length != 0)
			{
				for (var b = 0; b < iResponse.object.answer[a].result.length; b++)
				{
					stat += iResponse.object.answer[a].result[b].text + ' (' + iResponse.object.answer[a].result[b].percent + '%)<br />';
					stat += '<div class="statbar" style="width:' + iResponse.object.answer[a].result[b].width + 'px;"></div>';
				}
			}
			else
			{
				stat += 'No results<br />';
			}
			stat += '<br />';
		}
		document.getElementById('statframe').style.display = 'block';
		document.getElementById('stat').innerHTML = stat;
	}
	else
	{
		alert(iResponse.msg);
	}
}

function getExtStatistics(iDate,iType)
{
	getStat(iDate,iType,500,callBackGetExtStat);
}