var small_ads = "";

var ads   = new Array()
var rand  = new Array( 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14 );
var total = 15;

var ad = new Array()
var adtext = new Array()
var adurl = new Array()

ad[0]     = 'Ship&#39;s Knees Inn <em>Orleans</em>';
adtext[0] = 'Historic sea captain&#39;s home-pool. AC<br>WiFi, TV, short walk to Nauset Beach.';
adurl[0]  = 'www.shipskneesinn.com';

ad[1]     = 'Cranberry Cottages <em>Eastham</em>';
adtext[1] = 'Sunny studio &amp; 2-bedroom housekeeping<br>units on 4&#189; acres - ideal location!';
adurl[1]  = 'www.capecranberrycottages.com';

ad[2]     = 'Viking Shores Motel <em>Eastham</em>';
adtext[2] = '40 rms. heated pool. brkfst Bike trail<br>1.5 miles to bay/ocean. Family owned.';
adurl[2]  = 'www.vikingshores.com'; 

ad[3]     = 'Wellfleet Motel &amp; Lodge <em>Wellfleet</em>';
adtext[3] = '65 rooms. Indoor/outdoor pools.<br>Jacuzzi. Picnic area. Bar. Free WiFi';
adurl[3]  = 'www.wellfleetmotel.com'; 

ad[4]     = 'Nauset House Inn <em>Orleans</em>';
adtext[4] = 'Rated highest by course goers!<br>Rooms from $80, walk to Nauset Beach.';
adurl[4]  = 'www.nausethouseinn.com';
 
ad[5]     = 'Penny House Inn &amp; Spa <em>Eastham</em>';
adtext[5] = 'Luxury 12rm/suite priv baths qn/kng AC<br>brkfst/snacks WiFi heated pool, spa.';
adurl[5]  = 'www.pennyhouseinn.com';

ad[6]     = 'Parsonage Inn <em>E. Orleans</em>';
adtext[6] = '8 rms/pvt baths AC TV WiFi Nauset Bch.<br>Walk to restnts. Highly rated by Trip Advisor.';
adurl[6]  = 'www.parsonageinn.com';

ad[7]     = 'Peters Real Estate <em>Eastham</em>';
adtext[7] = 'Eastham/Wellfleet Rentals.<br>All types and prices.';
adurl[7]  = 'www.petersrealestate.us';

ad[8]     = 'Fort Hill B&amp;B  <em>Eastham</em>';
adtext[8] = 'Pvt Luxury Suites+Cottage AC WiFi In<br>Nat&#39;l Park w/ocean view! Quiet/Adult';
adurl[8]  = 'www.forthillbedandbreakfast.com';

ad[9]     = 'Night Heron B&amp;B   <em>Eastham</em>';
adtext[9] = 'Restful Cape Cod Home Highly rated by CCI<br>attendees, Brkfst, ac, WIFI, Pvt Baths';
adurl[9]  = 'www.nightheroncottage.com'; 

ad[10]     = '700 Samoset <em>Eastham</em>';
adtext[10] = 'Yesteryear elegance W/modern comforts.<br>Weekly Specials for Institute stays.';
adurl[10]  = 'www.700samosetbnb.com';
 
ad[11]     = 'Cape Cod Realty <em>Wellfleet</em>';
adtext[11] = 'Homes and Beach Cottages<br>Sales and Rentals';
adurl[11]  = 'www.capecodrealty.net';

ad[12]     = 'Hostels <em>Truro/Eastham</em>';
adtext[12] = 'Breakfast Daily. WiFi. Near Beach<br>&amp; Trails. Bed Rates start at $32.';
adurl[12]  = 'www.capecodhostels.org';

ad[13]     = 'Nauset House Guesthouse <em>Eastham</em>';
adtext[13] = 'Walk to Cape Cod Institute and Nauset<br>Light Beach. Superlative ratings';
adurl[13]  = 'home.comcast.net/~delfinol'; 

ad[14]     = 'Blue Dolphin Inn <em>Eastham</em>';
adtext[14] = 'Pool, patios, bbq, frig, laundry, WiFi<br>Bkfst. restaurant, near Nauset H.S.';
adurl[14]  = 'www.bluedolphincapecod.com';

 
shuffle = function(v){

    for(var j, x, i = v.length; i; j = parseInt(Math.random() * i), x = v[--i], v[i] = v[j], v[j] = x);
    return v;
};

shuffle(rand);

for ( cnt = 0; cnt < total; cnt++ )
  ads[cnt] = "<a href=\"http://" + adurl[rand[cnt]] + "\" class=\"adsurl\" target=\"_blank\"><span class=\"adstitle\">" + ad[rand[cnt]] + "</span><br><span class=\"adstext\">" + adtext[rand[cnt]] + "</span><br><span class=\"adurl\">" + adurl[rand[cnt]] + "</span></a>";

function print_smallads()
{

document.write(
'<table border="0" cellpadding="0" cellspacing="0">\n' +
' <tr><td colspan="2"><span class="sponsors">Lodging Sponsors:</span><br>&nbsp;</td></tr>\n' +
' <tr valign="top">\n' +
'  <td class="tdads">\n' +
'	  <div class="noline">' + ads[0] + '</div>\n' +
'	  <div class="noline">' + ads[1] + '</div>\n' +
'	  <div class="noline">' + ads[2] + '</div>\n' +
'	  <div class="noline">' + ads[3] + '</div>\n' +
'	  <div class="noline">' + ads[4] + '</div>\n' +
'	  <div class="noline">' + ads[5] + '</div>\n' +
'	  <div class="noline">' + ads[6] + '</div>\n' +
'	  <div class="noline">' + ads[7] + '</div>\n' +
'  </td>\n' +
'  <td class="tdads">\n' +
'	  <div class="noline">' + ads[8] + '</div>\n' +
'	  <div class="noline">' + ads[9] + '</div>\n' +
'	  <div class="noline">' + ads[10] + '</div>\n' +
'	  <div class="noline">' + ads[11] + '</div>\n' +
'	  <div class="noline">' + ads[12] + '</div>\n' +
'	  <div class="noline">' + ads[13] + '</div>\n' +
'	  <div class="noline">' + ads[14] + '</div>\n' +
'  </td>\n' +
' </tr>\n' +
'</table>\n');
  return true;
}           
