function printPoll(iPollID, iTotalVotes, aQuestions)
{
	var bVoted = readCookie('VotedPoll_' + iPollID) != '';
	var sHTMLCode =
		'<table width="320" border="0" cellspacing="0" cellpadding="0" bgcolor="#F24034">' +
		'<tr>' +
		'<td width="102" rowspan="2" valign="top" bgcolor="#F24034"><img src="img/joseencuesta-b.jpg" width="102" height="104" /></td>' +
		'<td background="img/bgencuesta-b.jpg" height="36" style="padding-top:8px"><font color="#FFFFFF" style="font-family:Verdana, Arial, Helvetica, sans-serif; font-size: 10px;"><b>' + sTitle + '</b></font></td>' +
		'</tr>' +
		'<tr>' +
		'<td bgcolor="#F24034">' +
		'<table width="218" border="0" cellspacing="0" cellpadding="0" bgcolor="#F24034">';

	if(iTotalVotes == 0) iTotalVotes = 1;

	for(var i = 0; i < aQuestions.length; i++)
		sHTMLCode += 
			bVoted ?
				(i != 0 ? '<tr><td colspan="3" height="2"></td></tr>' : '') +
				'<tr>' +
				'<td align="left">' + aQuestions[i][1] + '</td>' +
				'<td width="68" height="15" style="' +
				'background-image:url(http://lamp02.entravision.com/Tools/PollsModule/img/bg-barrita-porc.jpg);background-repeat:no-repeat";>' +
				'<img src="http://lamp02.entravision.com/Tools/PollsModule/img/barra_porcentaje' +
				((i % 6) + 1) +
				'.gif" ' +
				'height="15" ' +
				'width="' +
				round((aQuestions[i][2] / iTotalVotes) * 68) +
				'"/></td>' +
				'<td align="center">' + Math.round(aQuestions[i][2] * 100 / iTotalVotes) + ' %</td>' +
				'</tr>' :
				'<tr>' +
				'<td width="25">' +
				'<label>' +
				'<input name="PollOption" type="radio" ' +
				'value="' + aQuestions[i][0] + '" ' +
				'onClick="this.form.submit();"/>' +
				'</label>' +
				'</td>' +
				'<td>' + aQuestions[i][1] + '</td>' +
				'</tr>';

	sHTMLCode +=
		'</table>' +
		'</td>' +
		'</tr>' +
		'<tr>' +
		'<td valign="top" bgcolor="#CC0F0B" background="img/bgencuesta2-b.jpg">&nbsp;</td>' +
		'<td bgcolor="#CC0F0B" background="img/bgencuesta2-b.jpg">&nbsp;</td>' +
		'</tr>' +
		'</table>';

	document.write(sHTMLCode);
}

function round(dValue)
{
	var iValue = Math.round(dValue);

	if(iValue < 1)
		iValue = 1;

	return iValue;
}
