//
//  This routine builds the HTML code to place ad PREMIUM icons on the home page of FAP.
//  The values were calculated in icons.js, and this routine is called from

//  each "cell" on the home page of FAP.
//

function pfCell(pCellNo) {

//
//  These global values were already calculated in icons.js.
//
//
// prFrequency=1;      // How often we rotate, expressed in Days
// piIconMax;          // How many icons we're rotating
// prFullRotation;     // How many times icon @ #1 each year
// prRotations;        // Rotations to date this year
// prRotationsPct      // Percent of current rotation
// prFirstIcon;        // Position #0 Icon

//
//  Now, calculate which ad goes into this cell...
//
var piIdx = pCellNo + prFirstIcon

if (piIdx > (piIconMax - 1)) {
	piIdx = piIdx - piIconMax
}

document.write('<A HREF=' + piIconArrLink[piIdx] + '>')
document.write('<IMG SRC=' + piIconArrImag[piIdx] + ' HEIGHT=110 WIDTH=110 BORDER=1 ALT=' + piIconArrMeta[piIdx] + '></A>')

}