var nRecords, nFields;
nFields = 5;
nRecords = 5;
var arrRows = new Array(5);
for (i=0;i<5;i++) {
arrRows[i] = new Array(5);
}
arrRows[0][0] = "<A ONCLICK='LogClick(1,1,1);return(false);' HREF=''><IMG BORDER=0 WIDTH=422 HEIGHT=55 SRC='http://www.ftllodging.com/art/banners/hl_banner.gif' ALT='AMC Liquidators'></A>";
arrRows[0][1] = "http://www.amcliquidators.com";
arrRows[0][2] = "1";
arrRows[0][3] = "33";
arrRows[0][4] = "1";
arrRows[1][0] = "<A ONCLICK='LogClick(2,1,1);return(false);' HREF=''><IMG BORDER=0 WIDTH=422 HEIGHT=55 SRC='http://www.ftllodging.com/art/banners/wi_banner.jpg' ALT='Waterfront Inns'></A>";
arrRows[1][1] = "http://www.waterfrontinns.com";
arrRows[1][2] = "1";
arrRows[1][3] = "33";
arrRows[1][4] = "2";
arrRows[2][0] = "<A ONCLICK='LogClick(4,1,2);return(false);' HREF=''><IMG BORDER=0 WIDTH=126 HEIGHT=48 SRC='http://www.ftllodging.com/art/banners/shula_banner.gif' ALT='Shula's on the beach'></A>";
arrRows[2][1] = "http://www.shulasbeach.com";
arrRows[2][2] = "2";
arrRows[2][3] = "50";
arrRows[2][4] = "4";
arrRows[3][0] = "<A ONCLICK='LogClick(5,1,2);return(false);' HREF=''><IMG BORDER=0 WIDTH=126 HEIGHT=48 SRC='http://www.ftllodging.com/art/banners/blue_door_banner.gif' ALT='Blue Door Productions'></A>";
arrRows[3][1] = "http://www.bluedoorprod.com";
arrRows[3][2] = "2";
arrRows[3][3] = "50";
arrRows[3][4] = "5";
arrRows[4][0] = "<A ONCLICK='LogClick(6,1,1);return(false);' HREF=''><IMG BORDER=0 WIDTH=422 HEIGHT=55 SRC='http://www.ftllodging.com/art/banners/amex_banner.gif' ALT='American Express'></A>";
arrRows[4][1] = "http://www.americanexpress.com/merchant";
arrRows[4][2] = "1";
arrRows[4][3] = "33";
arrRows[4][4] = "6";
function LogClick(c,a,s)
{
var nIndex;
for (i=0;i<nRecords;i++) {
if (parseInt(arrRows[i][4]) == c) {
nIndex = i;
break;
}
}
eval("location.href = '/cgi_pages/track.asp?c=' + c + '&a=' + a + '&s=' + s + '&url=' + arrRows[nIndex][1]");}
function writeBanner(spot)
{
var nAd;
var randomly_selected_chance, chance_limit, sum_of_all_chances;
sum_of_all_chances = 0;
nAd = -1;
for (i=0;i<nRecords;i++) {
if (parseInt(arrRows[i][2]) == spot) {
sum_of_all_chances = sum_of_all_chances + parseInt(arrRows[i][3]);
}
}
chance_limit = 0;
randomly_selected_chance = Math.floor(Math.random()*1000);
for (i=0;i<nRecords;i++) {
if ((arrRows[i][2]) == spot) {
if (sum_of_all_chances > 0) {
chance_limit = chance_limit + Math.floor(((parseInt(arrRows[i][3]))/sum_of_all_chances)*1000);
if (randomly_selected_chance <= chance_limit) {
nAd = i;
break;
}
}
}
}
if (nAd == -1) {
nAd = 0;
}
document.write(arrRows[nAd][0])
}