function DisplayResults( MaxWidth, DisplayCountThreshold, StylePrefix )
{
	var Poll = GetPoll();
	document.writeln( '<table cellspacing="0" cellpadding="0" class="' + StylePrefix + 'PollResultsTable">' );
	var TotalPercent = 0;
	for( var o = 0; o < Poll.Options.length; o++ )
	{
		var ThisPercent = Math.round( Poll.Options[o].Percent );
		if( o == (Poll.Options.length-1) && (ThisPercent + TotalPercent) > 0 && (ThisPercent + TotalPercent) != 100 )ThisPercent = 100-TotalPercent;
		TotalPercent += ThisPercent;
		document.writeln( '<tr><td  class="' + StylePrefix + 'PollResultsTextCell">' + Poll.Options[o].Text + '</td><td class="' + StylePrefix + 'PollResultsBarCell"><table cellspacing="0" cellpadding="0" class="' + StylePrefix + 'PollResultsTable"><tr><td><div class="' + StylePrefix + 'PollResultsBar" style="width:' + Math.floor( ThisPercent / Math.round(Poll.GreatestPercent) * MaxWidth ) + 'px;"><img width="1" height="1" src=""></div></td><td class="' + StylePrefix + 'PollResultsValueCell">' + ( DisplayCountThreshold >= 0 && Poll.TotalVotes >= DisplayCountThreshold ? '' + Poll.Options[o].Count + '&nbsp;/&nbsp;' : '' ) + ThisPercent + '%</td></tr></table></td></tr>' );
	}
	document.writeln( '</table>' + ( DisplayCountThreshold >= 0 && Poll.TotalVotes >= DisplayCountThreshold ? '<p align="right"><span class="' + StylePrefix + 'PollResultsText">' + Poll.TotalVotes + ' total votes</span></p>' : '' ) );
}

function DisplayQuestion( StylePrefix )
{
	var Poll = GetPoll();
	document.writeln( '<span class="' + StylePrefix + 'PollResultsTitle">' + Poll.Question + '</span>' );
}

function GetPoll()
{
	Poll = new Array();
	Poll['ID'] = 47;
	Poll['Question'] = 'Does your toddler eat dinner with you?';
	Poll['TotalVotes'] = 72;
	Poll['GreatestCount'] = 61;
	Poll['GreatestPercent'] = 84.7222222222222;
	Poll['Options'] = new Array();
	Poll['Options'][0] = new Array();
	Poll['Options'][0]['Text'] = 'Yes';
	Poll['Options'][0]['Count'] = 61;
	Poll['Options'][0]['Percent'] = 84.7222222222222;
	Poll['Options'][1] = new Array();
	Poll['Options'][1]['Text'] = 'No';
	Poll['Options'][1]['Count'] = 11;
	Poll['Options'][1]['Percent'] = 15.2777777777778;
	return Poll;
}
