var xName  =new Array;
var xDate  =new Array;
var xPeriod  =new Array;
var xAmount  =new Array;


/* Change these details carefully and ensure they match the real cheques */
/*=======================================================================*/
xName[0]="STEPHEN GRIFFITHS & KATHRYN JOHNS"
xDate[0]="17\/5\/2001"
xPeriod[0]="200105"
xAmount[0]="1036.30"

xName[1]="GERARD & JUDITH LEAH"
xDate[1]="20\/2\/2001"
xPeriod[1]="200102"
xAmount[1]="1645.36"

xName[2]="MR C & MRS W MASON-PAULL"
xDate[2]="20\/2\/2001"
xPeriod[2]="200102"
xAmount[2]="42261.15"



/*=======================================================================*/
/* vvvvvvvvvvvvvvvvv TOUCH NOTHING BELOW HERE vvvvvvvvvvvvvvvvvv*/



var chqName;
var chqDate;
var chqPeriod;
var chqPounds;
var chqPence;
var chqWin;
var mtext = new Array
 mtext[0]="ZERO"
 mtext[1]="ONE"
 mtext[2]="TWO"
 mtext[3]="THREE"
 mtext[4]="FOUR"
 mtext[5]="FIVE"
 mtext[6]="SIX"
 mtext[7]="SEVEN"
 mtext[8]="EIGHT"
 mtext[9]="NINE"

var newWindow;

function get_mtext(offset)
{
	var amt;
	amt = chqPounds;
	while (amt.length < 6)
		amt = '0'+amt;
	return(mtext[amt.substring(offset,offset+1)]);
}

function cvt_amt()
{
var amt="";
var i;

	len = chqPounds.length;

	if (len > 3)
	{
		for (i=len-1 ; i>=0 ; i--)
		{
			amt = chqPounds.substring(i, i+1)+amt;
			if(amt.length == 3)
				amt = ","+amt;
		}
	}
	else
		amt = chqPounds;

	amt = amt+"."+chqPence;
	return(amt);
}


function dochq(num)
{
var ln;

w_width = screen.width-15;

if (num >= xName.length)
{
	num = 0;
}

ln = xAmount[num].length;
chqName = xName[num];
chqPeriod = xPeriod[num];
chqPounds = xAmount[num].substring(0,ln-3);
chqPence = xAmount[num].substring(ln-2,ln);
chqDate = xDate[num];
window.status='';
if (newWindow && !newWindow.closed)
	newWindow.close();
newWindow = window.open('',chqWin,'width='+w_width+',height=400,top=0,left=0');
newWindow.document.write('<HTML><HEAD><META http-equiv=Content-Type content="text/html; charset=windows-1252">');
newWindow.document.write('<TITLE>Proof of Earnings<\/TITLE>');
newWindow.document.write("<STYLE>BODY {FONT-WEIGHT: lighter; FONT-SIZE: 11px; COLOR: midnightblue; FONT-FAMILY: Arial}");
newWindow.document.write("TD {FONT-WEIGHT: lighter; FONT-SIZE: 9px; COLOR: midnightblue; FONT-FAMILY: Tahoma}");
newWindow.document.write("TH {FONT-WEIGHT: lighter; FONT-SIZE: 11px; COLOR: white; FONT-FAMILY: Arial; BACKGROUND-COLOR: midnightblue}");
newWindow.document.write("H4 {FONT-WEIGHT: bolder; FONT-SIZE: 16px; COLOR: black; FONT-FAMILY: Courier}");
newWindow.document.write("<\/STYLE><\/HEAD><BODY bgColor=white><CENTER><H3><U>Certificate of Income<\/U><\/H3><\/CENTER>");
newWindow.document.write("<P>The Certificate of Income shown below is the official company payment for the 4 - week period number "+chqPeriod+" <BR><BR><\/P>");
newWindow.document.write('<TABLE style="BORDER-RIGHT: midnightblue 1px solid; BORDER-TOP: midnightblue 1px solid; BORDER-LEFT: midnightblue 1px solid; BORDER-BOTTOM: midnightblue 1px solid" cellSpacing=0 cellPadding=0 width="100%">');
newWindow.document.write('<TBODY><TR><TD><BR>&nbsp;&nbsp;&nbsp; <BR><BR>');
newWindow.document.write('<TABLE style="BORDER-RIGHT: lightsteelblue 1px solid; BORDER-TOP: lightsteelblue 1px solid; BORDER-LEFT: lightsteelblue 1px solid; BORDER-BOTTOM: lightsteelblue 1px solid" width="100%" bgColor=#c4d8f2>');
newWindow.document.write('<TBODY><TR><TD width="75%">');
newWindow.document.write('<TABLE width="100%">');
newWindow.document.write('<TBODY><TR><TD colSpan=2><BR><BR><\/TD><\/TR>');
newWindow.document.write('<TR><TD width="100%"><H5>Pay:<FONT face=Courier color=black><U>'+chqName+'<\/U><\/FONT> <\/H5><\/TD><\/TR><\/TBODY><\/TABLE><\/TD>');
newWindow.document.write('<TD vAlign=baseline><H5>Date:<U><FONT face=courier color=black>__'+chqDate+'________<\/FONT><\/U><\/H5><\/TD><\/TR>');
newWindow.document.write('<TR><TD><TABLE borderColor=midnightblue cellSpacing=0 borderColorDark=midnightblue cellPadding=0 width="100%" borderColorLight=midnightblue border=1>');
newWindow.document.write('<TBODY><TR><TD align=middle colSpan=6>THE SUM IN POUNDS PENCE AS IN FIGURES <\/TD><\/TR>');
newWindow.document.write('<TR><TD align=middle width="16%">Hundred Thousands<\/TD><TD align=middle width="16%">Ten Thousands<\/TD><TD align=middle width="16%">Thousands<\/TD><TD align=middle width="16%">Hundreds<\/TD><TD align=middle width="16%">Tens<\/TD><TD align=middle width="16%">Units<\/TD><\/TR>');
newWindow.document.write('<TR><TD align=middle width="16%"><H4><BR>'+get_mtext(0)+'<\/H4><\/TD><TD align=middle width="16%"><H4><BR>'+get_mtext(1)+'<\/H4><\/TD><TD align=middle width="16%"><H4><BR>'+get_mtext(2)+'<\/H4><\/TD><TD align=middle width="16%"><H4><BR>'+get_mtext(3)+'<\/H4><\/TD><TD align=middle width="16%"><H4><BR>'+get_mtext(4)+'<\/H4><\/TD><TD align=middle width="16%"><H4><BR>'+get_mtext(5)+'<\/H4><\/TD><\/TR><\/TBODY><\/TABLE><\/TD>');
newWindow.document.write('<TD><TABLE borderColor=lightsteelblue width="100%" bgColor=#c4d8f2 border=1 VALIGN="center">');
newWindow.document.write('<TBODY><TR vAlign=center><TD vAlign=center><BR><H4>&nbsp;&nbsp;&pound;'+cvt_amt()+'<\/H4><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR>');
newWindow.document.write('<TR><TD align=right colSpan=2><TABLE><TBODY><TR><TD colSpan=2><\/TD><\/TR>');
newWindow.document.write('<TR><TD align=middle>George R Pollock<BR>Managing Director<\/TD><TD align=middle>Kim P Rawson<BR>Sales Director<\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR>');
newWindow.document.write('<TR><TD><\/TD><\/TR><\/TBODY><\/TABLE><\/TD><\/TR>');
newWindow.document.write('<\/TBODY><\/TABLE>');
newWindow.document.write("<\/BODY><\/HTML>");
newWindow.document.close();
window.status='';
newWindow.focus();
}
