// lodging.js
var vLodges;
var imgDir;
var bShowAllInclusive;
var lastRegion;

function writeLodging( region )
{
    lastRegion = "";
    bShowAllInclusive = false;

    document.writeln ( "<table BORDER=1 CELLSPACING=0 CELLPADDING=1>" );

    document.writeln ( "<tr>" );
    document.writeln ( "<th class=lodging>lodging" );
    document.writeln ( "<th class=lodging>$US / night" );
    document.writeln ( "<th class=lodging>rating" );
    document.writeln ( "<th class=lodging>notes" );

    var RegionList;
    RegionList = region.split("|");
    for ( var rr = 0; rr < RegionList.length; rr++ )
    {
        for ( var ndx = 0; ndx < vLodges.length; ndx++ )
        {
            if ( ("*" == region) || (RegionList[rr] == vLodges[ndx][0]) )
            {
                writeLodgingLine( ndx );
            }
        }
    }

    document.writeln ( "</table>" );
    if ( bShowAllInclusive )
    {
        document.writeln ( "* all inclusive - all meals were provided.  This was often the case because there was nowhere else to go." );
    }
}  // writeLodging

//----------------------------------------------------------------------------
function writeLodgingLine( ndx )
{
    if ( vLodges[ndx][0] != "end" )
    {
        if ( lastRegion != vLodges[ndx][0] )
        {
            document.writeln ( "<tr>" );
            document.writeln ( "<th class=lodging align=left colspan=4>" + vLodges[ndx][0]);
            lastRegion = vLodges[ndx][0];
        }
        document.writeln ( "<tr valign=top>" );
        document.writeln ( "<td nowrap class=lodging>" + vLodges[ndx][1] );   // lodge
        document.writeln ( "<td class=lodging>$" + vLodges[ndx][2] );  // cost
        if ( 0 < vLodges[ndx][3] )
        {
            document.writeln ( "*" );  // all inclusive
            bShowAllInclusive = true;
        }
        // rating
        document.writeln ( "<td nowrap class=lodging>" );
        rating = Math.floor(vLodges[ndx][4]);
        for ( var pig = 0; pig < rating; pig++ )
        {
            document.writeln ( "<IMG src='" + imgDir + "RatingPig.gif'>" );
        }
        if ( rating < vLodges[ndx][4] )
        {
            document.writeln ( "<IMG src='" + imgDir + "RatingHalfPig.gif'>" );
        }
        document.writeln ( "<td class=lodging>" + vLodges[ndx][5] );  // notes
    }
}  // writeLodgingLine

//----------------------------------------------------------------------------
function initLodging()
{
    imgDir = "../../images/";
    vLodges = [
        // region           lodging                    $US / night
        // |                |                          |      all inclusive (0=no, 1=yes)
        // |                |                          |      |  rating
        // |                |                          |      |  |   comments
        [ "Fiji",           "Saweni Beach",            21.62, 0, 2, "poor location, but the accomodations were acceptable" ],
        [ "Fiji",           "Nabua Lodge",             36.19, 1, 3, "great location.  the accomodations were primitive" ],
        [ "Fiji",           "Otto and Fanny's",        75.01, 1, 3, "great all around.  best food in the Yasawa group" ],
        [ "Fiji",           "Sunseeker",               18.10, 0, 2, "basic backpacker" ],
        [ "Christchurch",   "Stonehurst",              24.60, 0, 4, "outstanding!" ],
        [ "Christchurch",   "Foley Towers",            18.04, 0, 3, "pretty gardens" ],
        [ "Akaroa",         "Chez la Mer",             16.60, 0, 3, "Beautiful house and gardens" ],
        [ "Akaroa",         "Linton House B&amp;B",    49.20, 0, 4, "Very romantic!" ],
        [ "Akaroa",         "Charlie B's (Ch-Ch)",     24.60, 0, 3, "Apartment/Flat" ],
        [ "Catlins",        "Manor House Backpackers", 16.40, 0, 2, "Good location, but noisy neighbors." ],
        [ "Catlins",        "Curio Bay Backpackers",   14.76, 0, 3, "Great location. A bit rustic." ],
        [ "Catlins",        "Hill Top Backpackers",    18.45, 0, 4, "Fantastic!!" ],
        [ "Catlins",        "Southern Comfort",        16.40, 0, 3, "Nice, comfortable place (but crowded)" ],
        [ "Catlins",        "<a target=_blank href='DunedinCatlins/Louies.html'>Louies Restaurant</a>", 45.00, 0, 4, "Excellent! Great ambiance &amp; food!" ],
        [ "Stewart Island", "Jo &amp; Andy's B&amp;B", 16.40, 0, 2, "Comfy room, good breakfast, but too much smoke." ],
        [ "Fiordlands",     "Possum Lodge",            16.40, 0, 3, "Great lake front view! Comfy." ],
        [ "Fiordlands",     "Barnyard Backpackers",    18.04, 0, 3, "Private and quiet." ],
        [ "Queenstown",     "Butterfli",               (50.0 * 0.42), 0, 2, "new but not homey." ],
        [ "Wanaka",         "Wanaka Bakpaka",          (44.0 * 0.42), 0, 3, "A great room with private bath, nice setup" ],
        [ "Okuru",          "<a target=_blank href='http://www.okurubeach.co.nz'>Okuru Beach B&B</a>", (60.0 * 0.42), 0, 2, "Comfortable stay, but nothing to see/do" ],
        [ "WestCoast",      "Chateau Franz Josef Backpackers",         (40.0 * 0.42), 0, 2, "Eclectic, a little crowded" ],
        [ "WestCoast",      "Forest Park Cabin",        23.10, 0, 3, "private, quiet and all amenities" ],
        [ "WestCoast",      "Punakaiki Beach Hostel",   18.04, 0, 3, "on the beach" ],
        [ "Marlborough",    "The Palace",               20.05, 0, 3, "we got lucky with an apartment to ourselves" ],
        [ "Marlborough",    "The Villa",                18.86, 0, 3, "friendly place, centrally located" ],
        [ "Marlborough",    "Resolution Bay",           16.40, 0, 2, "Very rustic, but charming" ],
        [ "Marlborough",    "Endeavour Lodge",          16.40, 0, 1, "Very cold, bunk beds" ],
        [ "Marlborough",    "Punga Cove Resort",        28.70, 0, 4, "Ahhhh..." ],
        [ "Marlborough",    "Portage Shop",             18.45, 0, 3, "Comfortable" ],
        [ "Wellington",     "Lower Hutt Holiday Park",  30.75, 0, 3, "All amenities" ],
        [ "Wellington",     "Rowena",                   18.45, 0, 2, "Older, cramped kitchen" ],
        [ "Napier",         "Waterfront Lodge",         18.86, 0, 2, "Older, but comfy" ],
        [ "Napier",         "Aqua Lodge",               18.45, 0, 2, "A bit cramped" ],
        [ "Taupo",          "Orakei Korako Lodge",      18.45, 0, 3, "We had it all to ourselves" ],
        [ "Taupo",          "Extreme Backpacker's",     16.40, 0, 3, "Modern, comfortable rooms" ],
        [ "Rotorua",        "Funky Green Voyager",      17.63, 0, 3, "The friendliest staff in NZ" ],
        [ "Whitianga",      "Coromandel Lodge",         18.04, 0, 3, "Nice apartment units" ],
        [ "Coromandel Town","Whitehouse",               13.12, 0, 2, "Old but very charming" ],
        [ "Kahoe",          "Kahoe Farms",              18.45, 0, 3, "Gotta try their pizza!" ],
        [ "Paihia",         "Mousetrap",                16.40, 0, 2, "A bit run-down, but good views" ],
        [ "Kohukohu",       "TreeHouse",                18.04, 0, 3.5, "Very beautiful setting & building, almost 4 pigs" ],
        [ "Auckland",       "Marco Polo",               16.40, 0 ,3, "Nice wood building" ],
        [ "Auckland",       "City Gardens",             18.86, 0, 3, "Old victorian house, we had best room w/view!" ],
        [ "Melbourne",      "Enfield House",            26.00, 0, 1, "Unkempt and critters in the ceiling" ],
        [ "Melbourne",      "<a target=_blank href=\"http://www.olembia.com.au\">Olembia</a>", 33.28, 0, 3, "Clean, quaint manor house" ],
        [ "Apollo Bay",     "Angela's Guest House",     Math.floor(65 * 52) / 100, 0, 4, "Includes breakfast on the room's balcony. Great value." ],
        [ "Adelaide",       "Backpack Oz",              Math.floor(43 * 52) / 100, 0, 2, "basic, friendly, relatively convenient" ],
        [ "Outback",        "<a target=_blank href='http://users.senet.com.au/~cannonst/headb/h1.html'>Heading Bush</a>",
                                                        Math.floor(1024 / 10 / 2), 0, 3, "a fantastic way to see the outback. primitive camping not for the shovel shy" ],
        [ "Alice Springs",  "Annie's Place",            28.6, 0, 3, "friendly staff, very accomodating" ],
        [ "Alice Springs",  "Elke Outbackpackers",      23.4, 0, 3, "kitchenette & bathroom shared btwn 2 rooms" ],
        [ "Northern Territory", "Remote Possibilities", Math.floor(205.92 / 2), 0, 1, "not very professional" ],
        [ "Darwin",         "Chili's Backpacker",       26.0, 0, 2, "adequate" ],
        [ "Kuta",           "Camplung Mas",             48.88, 0, 3 , "Nice, but overpriced" ],
        [ "Kuta",           "Komala Indah Cottages",    9.43, 0, 3, "Well kept, comfortable rooms" ],
        [ "Ubud",           "Suartha",                  6.66, 0, 2, "Charming, but too many insects" ],
        [ "Ubud",           "Candra Asri",              7.77, 0, 3, "Comfy room, pretty garden setting" ],
        [ "Toya Bungkah",   "Volcano II",               3.88, 0, 1, "Very basic" ],
        [ "Lovina",         "Nirwana Sea Side Cottages", 11.09, 0, 3, "Fantastic setting, small room" ],
        [ "Gilimanuk",      "Lestari Homestay",         13.37, 0, 2, "O.K. room, bad location" ],
        [ "Mt. Bromo",      "Lava View Hotel",          23.26, 0, 2, "Overpriced, past it's prime - but good location" ],
        [ "Yogyakarta",     "Prambanan Guesthouse",     9.77, 0, 3, "Very comfortable, great value" ],
        [ "Candidasa",      "<a target=_blank href='http://www.indo.com/hotels/grand_natia'>The Grand Natia</a> &lt<a href='mailto:hotelnatia@yahoo.com'>hotelnatia@yahoo.com</a>&gt",          14.53, 0, 4, "Awesome! Unbelievable value" ],
        [ "Bangkok",        "<a target=_blank href='http://www.newsiam.net/'>New Siam I</a>",               Math.floor(420 / 44), 0, 3, "Clean and quiet" ],
        [ "Bangkok",        "New Siam II",  Math.floor(550 / 44), 0, 3.5, "New, clean, comfortable" ],
        [ "Koh Samui",      "Coco Palm",                11.36, 0, 2.5, "Nice, but thatched ceiling" ],
        [ "Koh Samui",      "Samui Island Resort",      13.64, 0, 2.5, "Great beach, basic room" ],
        [ "Koh Pha-Ngan",   "Top Hill Resort",          11.36, 0, 3, "New, clean, quiet, nice view - but far from beach" ],
        [ "Koh Samui",      "O.P. Bungalows",           15.91, 0, 3, "Clean, air con, central but quiet" ],
        [ "Chiang Mai",     "Chiang Mai Travel Lodge",  9.09,  0, 2.5, "Old, dingy, but clean. Convenient location" ],
        [ "Chiang Khong",   "Hua Wiang Country House",  3.41,  0, 2, "Old, basic, but clean" ],
        [ "Pakbeng",        "Villa Salika",             10.64, 0, 2.5, "Overpriced, but only decent accomodation in Pakbeng" ],
        [ "Luang Prabang",  "Jaliya GH",                4.26,  0, 2.5, "Nice courtyard,friendly staff, basic room, hard bed" ],
        [ "Luang Prabang",  "Mano GH",                  4.26,  0, 3.5, "Brand new, excellent!" ],
        [ "Vientiane",      "Sihom GH",                 9.57,  0, 2, "Overpriced, basic" ],
        [ "Kathmandu",      "Tibet Guest House",        13.00, 0, 3, "Best double room for the value in Kathmandu" ],
        [ "Pokhara",        "Hotel Tulsi",              10.00, 0, 3, "Great views on the upper floors" ],
        [ "Annapurna",      "tea houses on the circuit", 13.00, 1, 1, "Some were better than others. Most had primitive toilets. Prices increased with the elevation." ],
        [ "Siem Reap",      "Green Garden Guest House", 20.00, 0, 3, "Clean, comforatble, refrigerator and A/C" ],
        [ "Railay",         "Viewpoint",                Math.floor(700 / 43), 0, 3, "Comfortable" ],
        [ "Railay",         "Mountain View",            Math.floor(650 / 43), 0, 3, "New, comfortable, but limited electricity" ],
        [ "Phi Phi",        "Andaman I GH",             Math.floor(1200 / 43), 0, 3, "Fine but bathroom smells of sewage" ],
        [ "Phi Phi",        "Gipsy I",                  Math.floor(500 / 43), 0, 2, "Basic, most affordable during high season" ],
        [ "Phuket",         "Boomerang",                Math.floor(800 / 43), 0, 3, "All the comforts (hot water, A/C, TV), but not much character" ],
        [ "Sukhothai",      "Lotus Village",            Math.floor(550 / 43), 0, 3.5, "Beautiful setting, comfortable room" ],
        [ "Ayutthaya",      "Chantana GH",              Math.floor(300 / 43), 0, 3, "Basic, new and clean" ],
        [ "Singapore",      "Regalis Court",            55.38, 0, 3.5, "Charming, wood floors, antique furniture." ],
        [ "Cape Town",      "Simply The Best Backpackers", 14.29, 0, 2, "Basic" ],
        [ "Arniston",       "South of Africa Backpackers", 17.14, 0, 3, "Clean and sterile, lacks character" ],
        [ "Knysna",         "Brenton on Sea Hotel",     Math.floor(350 / 10.9), 0, 4, "Fantastic ocean view, log cabin, in room jacuzzi" ],
        [ "Outshoorn",      "Tom's Mill B&amp;B",       Math.floor(200 / 10.9), 0, 3.5, "Very charming, garden setting in the heart city" ],
        [ "Paarl",          "Jacky's Place B&amp;B",    Math.floor(250 / 10.9), 0, 3, "Comfortable" ],
        [ "Cape Town",      "Oak Lodge",                Math.floor(180 / 10.9), 0, 3, "Beautiful Victorian place but be sure to ask for a room in their apt. building next door (quieter)" ],
        [ "Cape Town",      "The Backpack",             Math.floor(300 / 10.9), 0, 2, "Overpriced. Nice bar and pool but the rooms are minimal." ],
        [ "Africa",         "Wildlife Adventures",      700, 1, 4, "A great way to see the vast expanse of southern Africa" ],
        [ "Victoria Falls", "Shoestring Backpackers",   20, 0, 3, "Good location, safe, friendly" ],
        [ "Johannesburg",   "Airport Backpackers",      Math.floor(150 / 10.9), 0, 1.5, "Convenient to the airport" ],
        [ "Johannesburg",   "Eastgate Backpackers",     Math.floor(170 / 10.9), 0, 3, "One good double ensuit room and good, safe location" ],
        [ "Kruger Park",    "<a target=_blank href='http://www.elephantplains.co.za'>Elephant Plains Bush Lodge</a>", "~", 0, 4, "Excellent service and accomodation" ],
        [ "Kruger Park",    "<a target=_blank href='http://www.nkorho.com'>Nkorho Bush Lodge</a>", "~", 0, 3.5, "Another great bush lodge" ],
        [ "Madrid",         "Hostal Macarena",          Math.floor( 63 * 0.89 ), 0, 3, "Nice, but overpriced" ],
        [ "Madrid",         "Hostal Riesco",            Math.floor( 41 * 0.89 ), 0, 3, "Good location, comfortable, nice but small rooms" ],
     // [ "Barcelona",      "Hostal ?",                 Math.floor( 36 * 0.89 ), 0, 2, "Clean, but small rooms.  no rooms with attached bath" ],
        [ "Barcelona",      "<a target=_blank href='http://www.hostallevante.com'>Hostal Levante</a>",           Math.floor( 48 * 0.89 ), 0, 3, "Good location, clean, comfortable room" ],
     // [ "Huesca",         "Hostal ?",                 Math.floor( 30 * 0.89 ), 0, 2.5, "you get a lot for for your oney in the country" ],
        [ "Pamplona",       "Hostal Bearan",            Math.floor( 36.50 * 0.89 ), 0, 3, "Very clean, good location" ],
     // [ "Cuenca",         "Hostal ?",                 Math.floor( 30 * 0.89 ), 0, 3, "More than adequate, but boring location" ],
        [ "Toledo",         "<a target=_blank href='http://www.hostalsantotome.com/'>Hostal Santo Tomé</a>",        Math.floor( 45 * 0.89 ), 0, 3.5, "Great location, very nice room" ],
        [ "Madrid",         "Emma & Cesar",             Math.floor( 0 * 0.89 ), 0, 4, "Beautifully decorated, charming staff" ],
        [ "Mellendorf",     "Rastätte Mellendorf",      Math.floor( 55 * 0.89 ), 0, 3, "Very clen, comfortable. Includes breakfast." ],
        [ "Kiel",           "Chrissy &amp; Kai's Place", 0, 1, 4, "The staff goes out of it's way to make you feel at home." ],
        [ "Hamburg",        "Hotel Bremer",             Math.floor( 55 * 0.89 ), 0, 2.5, "Clean, but prostitutes outside the door" ],
        [ "Bremen",         "Hotel Bremen Haus",        Math.floor( 61 * 0.89 ), 0, 3, "comfortable and good breakfast" ],
        [ "Emdem",          "Uwe and Karin's Vacation House", 0, 0, 4, "cozy lodge and friendly staff" ],
        [ "Heerenveen",     "Elly &amp; Richard's",     0, 0, 4, "much more comfortable than the hut in Fiji" ],
        [ "Amsterdam",      "France Hotel",             Math.floor( 58 * 0.89 ), 0, 2.5, "clean room but hot and stuffy" ],
        [ "Boppard",        "Royal Hotel",              Math.floor( 43 * 0.89 ), 0, 2.5, "Quaint place on the Rhime" ],
        [ "Munich",         "Marion's Place",           0, 0, 4, "Cozy, homey atomsphere" ],
        [ "Heidelburg",     "Hotel Zeiglerbrau",        Math.floor( 55 * 0.89 ), 0, 2.5, "clean and comfortable" ],
        [ "Hirschau",       "Lodge Weich Gasthof",      Math.floor( 42 * 0.89 ), 0, 2, "basic room in a small town" ],
        [ "Prague",         "<a target=_blank href='http://www.brezina.cz/brezina.htm'>Pension Brezina</a>",  Math.floor( 2000 / 33 ), 0, 3, "clean comfortable, free internet &amp; parking" ],
        [ "Washington, D.C.",   "Mami &amp; Papi", 0, 1, 4, "No place like home" ],
        [ "Miami",          "Mario &amp; Christy's", 0, 0, 2, "We're waiting for the new place ..." ],
        [ "Boyton Beach",   "Rose", 0, 0, 3, "Very hospitable with an excellent tea service" ],
        [ "Key West",       "YHA", 74, 0, 2.5, "Our first hostel in America" ],
        [ "Key West",       "Speakeasy Inn", 74, 0, 3, "Good atomsphere, right on Duval" ],
        [ "Austin",         "Mom G.'s place", 0, 0, 3, "Lovely place but some household chores are expected" ],
        [ "end",            "lodging",                  0,     0, 0, "comments" ]
    ];
}  // initLodging