oHtmlTop5='<tr><td height="40" align="center" valign="middle"><img border="0" src="i/t5head.gif" width="141" height="31"></td></tr>';

//start loop (ignores all set to position 0
for (var i=1; i < 6; i++)
	{
	if (pnumb[i]==null)
		{}
	else
		{
		createPlate(i);
		popupLink =	"top5pop.htm?top5pos="+i;
		oHtmlTop5 += '<tr>';
 		oHtmlTop5 += '<td height="55" align="center" class="t5" onclick="javascript:window.focus();popUpH(\'' + popupLink + '\', \'npt\', 315,330,\'tr\');" ' + plateStyle + '>' + modPnumb + '</td>';
 		oHtmlTop5 += '</tr>';
		}
	}

oHtmlTop5 += '<tr><td height="55" align="center" class="t5txt"><strong>your plate here for free!</strong><br>(conditions apply)</td></tr>';

function createPlate(i)
{
	switch (state[i].toLowerCase())
		{
		case 'act' : stid=1;break;
		case 'nsw' : stid=2;break;
		case 'nt'  : stid=3;break;
		case 'nz'  : stid=4;break;
		case 'qld' : stid=5;break;
		case 'sa'  : stid=6;break;
		case 'tas' : stid=7;break;
		case 'vic' : stid=8;break;
		case 'wa'  : stid=9;break;
		}

	ePnumb=pnumb[i];
	modPnumb=pnumb[i];

	chkChar=pnumb[i].indexOf(".");
	if (chkChar != -1)
		{
		modPnumb=pnumb[i].substring(0,chkChar) + '&#183;' + pnumb[i].substring(chkChar + 1,pnumb[i].length );
		ePnumb=pnumb[i];
		}

	chkChar=pnumb[i].indexOf(" ");
	if (chkChar != -1)
		{
		modPnumb=pnumb[i].substring(0,chkChar) + '&nbsp;' + pnumb[i].substring(chkChar + 1,pnumb[i].length );
		ePnumb=pnumb[i].substring(0,chkChar) + '%20' + pnumb[i].substring(chkChar + 1,pnumb[i].length );		
		}

	plateStyle='style="background-image: url(i/p' + stid + pback[i] + '.gif); color: ' + ptext[i] +'"' 
}