//scripts for the goose & turrets reservations page
// Ultimate client-side JavaScript client sniff. Version 3.01
// (C) Netscape Communications 1999-2001.  Permission granted to reuse and distribute.
// Revised 17 May 99 to add is_nav5up and is_ie5up (see below).
// Revised 20 Dec 00 to add is_gecko and change is_nav5up to is_nav6up
//                      also added support for IE5.5 Opera4&5 HotJava3 AOLTV
// Revised 22 Feb 01 to correct Javascript Detection for IE 5.x, Opera 4, 
//                      correct Opera 5 detection
//                      add support for winME and win2k
//                      synch with browser-type-oo.js

// Everything you always wanted to know about your JavaScript client
// but were afraid to ask. Creates "is_" variables indicating:
// (1) browser vendor:
//     is_nav, is_ie, is_opera, is_hotjava, is_webtv, is_TVNavigator, is_AOLTV
// (2) browser version number:
//     is_major (integer indicating major version number: 2, 3, 4 ...)
//     is_minor (float   indicating full  version number: 2.02, 3.01, 4.04 ...)
// (3) browser vendor AND major version number
//     is_nav2, is_nav3, is_nav4, is_nav4up, is_nav6, is_nav6up, is_gecko, is_ie3,
//     is_ie4, is_ie4up, is_ie5, is_ie5up, is_ie5_5, is_ie5_5up, is_hotjava3, is_hotjava3up,
//     is_opera4, is_opera5, is_opera5up
// (4) JavaScript version number:
//     is_js (float indicating full JavaScript version number: 1, 1.1, 1.2 ...)
// (5) OS platform and version:
//     is_win, is_win16, is_win32, is_win31, is_win95, is_winnt, is_win98, is_winme, is_win2k
//     is_os2
//     is_mac, is_mac68k, is_macppc
//     is_unix
//     is_sun, is_sun4, is_sun5, is_suni86
//     is_irix, is_irix5, is_irix6
//     is_hpux, is_hpux9, is_hpux10
//     is_aix, is_aix1, is_aix2, is_aix3, is_aix4
//     is_linux, is_sco, is_unixware, is_mpras, is_reliant
//     is_dec, is_sinix, is_freebsd, is_bsd
//     is_vms
//
// See http://www.it97.de/JavaScript/JS_tutorial/bstat/navobj.html and
// http://www.it97.de/JavaScript/JS_tutorial/bstat/Browseraol.html
// for detailed lists of userAgent strings.
//
// Note: you don't want your Nav4 or IE4 code to "turn off" or
// stop working when new versions of browsers are released, so
// in conditional code forks, use is_ie5up ("IE 5.0 or greater") 
// is_opera5up ("Opera 5.0 or greater") instead of is_ie5 or is_opera5
// to check version in code which you want to work on future
// versions.

    // convert all characters to lowercase to simplify testing
    var agt=navigator.userAgent.toLowerCase();

    // *** BROWSER VERSION ***
    // Note: On IE5, these return 4, so use is_ie5up to detect IE5.
    var is_major = parseInt(navigator.appVersion);
    var is_minor = parseFloat(navigator.appVersion);

    // Note: Opera and WebTV spoof Navigator.  We do strict client detection.
    // If you want to allow spoofing, take out the tests for opera and webtv.
    var is_nav  = ((agt.indexOf('mozilla')!=-1) && (agt.indexOf('spoofer')==-1)
                && (agt.indexOf('compatible') == -1) && (agt.indexOf('opera')==-1)
                && (agt.indexOf('webtv')==-1) && (agt.indexOf('hotjava')==-1));
    var is_nav2 = (is_nav && (is_major == 2));
    var is_nav3 = (is_nav && (is_major == 3));
    var is_nav4 = (is_nav && (is_major == 4));
    var is_nav4up = (is_nav && (is_major >= 4));
    var is_navonly      = (is_nav && ((agt.indexOf(";nav") != -1) ||
                          (agt.indexOf("; nav") != -1)) );
    var is_nav6 = (is_nav && (is_major == 5));
    var is_nav6up = (is_nav && (is_major >= 5));
    var is_gecko = (agt.indexOf('gecko') != -1);


    var is_ie     = ((agt.indexOf("msie") != -1) && (agt.indexOf("opera") == -1));
    var is_ie3    = (is_ie && (is_major < 4));
    var is_ie4    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5")==-1) );
    var is_ie4up  = (is_ie && (is_major >= 4));
    var is_ie5    = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.0")!=-1) );
    var is_ie5_5  = (is_ie && (is_major == 4) && (agt.indexOf("msie 5.5") !=-1));
    var is_ie5up  = (is_ie && !is_ie3 && !is_ie4);
    var is_ie5_5up =(is_ie && !is_ie3 && !is_ie4 && !is_ie5);

    var is_win   = ( (agt.indexOf("win")!=-1) || (agt.indexOf("16bit")!=-1) );
    var is_mac    = (agt.indexOf("mac")!=-1);


//image preloader
		
		rollover = document.images;
function LoadGIF(image) {
                if (rollover) {
                    eval (image + '= new Image()');     // Let browser do GC
                    eval (image + '.src  = "images/' + image + '.gif"');
                }
       }

		LoadGIF('n_about_on');
		LoadGIF('n_about_off');
		LoadGIF('n_bkfst_menus_on');
		LoadGIF('n_bkfst_menus_off');
		LoadGIF('n_contact_on');
		LoadGIF('n_contact_off');
		LoadGIF('n_credits_on');
		LoadGIF('n_credits_off');
		LoadGIF('n_directions_on');
		LoadGIF('n_directions_off');
		LoadGIF('n_fun_on');
		LoadGIF('n_fun_off');
		LoadGIF('n_history_on');
		LoadGIF('n_history_off');
		LoadGIF('n_home_on');
		LoadGIF('n_home_off');
		LoadGIF('n_owners_on');
		LoadGIF('n_owners_off');
		LoadGIF('n_rooms_rates_on');
		LoadGIF('n_rooms_rates_off');
		LoadGIF('n_specials_on');
		LoadGIF('n_specials_off');
		LoadGIF('n_teatime_on');
		LoadGIF('n_teatime_off');
		LoadGIF('b_rsvp_now_on');
		LoadGIF('b_rsvp_now_off');
		LoadGIF('b_submit_star_on');
		LoadGIF('b_submit_star_off');
		

function but_on(butname, imagename) {
	var imagepath = document.images;
	// Turn off nav item
	eval("imagepath." + imagename + ".src='i/" + butname + "_on.gif'");
}

function but_off(butname, imagename) {
	var imagepath=document.images;
	// Turn on nav item
	eval("imagepath." + imagename + ".src='i/" + butname + "_off.gif'");
}



//rotating testimonials
var testimonial = new Array();

testimonial[0] = "<p><strong>\"Serenity, graciousness, and hospitable ease.\" <em>San Mateo Times</em></strong><br><br>\"Inn of the Week.\" <em>Jerry Hulse, Los Angeles Times</em><br><br>\"…this isn't any ordinary bed and breakfast…but it has character and the most intellectually stimulating innkeepers around.\" <em>Offbeat Overnights</em><br><br>\"…the Goose & Turrets B&B still has a Bohemian quality to it…but the best part of this inn is actually outdoors.\" <em>Frommer's Bed and Breakfasts in California</em></p>";

testimonial[1] = "<p><strong>\"A home away from home…comfy, unpretentious. The inn's magic is a serene world.\"<em>Peninsula Times Tribune</em></strong><br><br>\"Emily and Raymond embody the mixture of hospitality, culture and fascination that mark the Goose & Turrets.\" <em>Half Moon Bay Review</em><br><br>\"The service is wonderful. The innkeepers are great conversationalists and fine hosts who give you personal attention.\" <em>America's Wonderful Little Hotels & Inns</em></p>";

testimonial[2] = "<p><strong>\"An ideal country escape…The wonderful old building has been refurbished and decorated to reflect the hosts' myriad interests and world travels.\" <em>Diane Knight, Bed & Breakfast Directory</em></strong><br><br>\"The aspiring artist could simply sit in bed and sketch the Monterey cypress spreading against the sky…The breakfast will undoubtedly last you well into the day.\" <em>Contra Costa Times</em><br><br>\"The Goose & Turrets provides an enjoyable and comfortable stay…Raymond and Emily Hoche-Mong are charming, well traveled hosts…both love to cook, and breakfasts attest to their culinary capabilities and creativity.\" <em>Tea Talk Newsletter</em><br><br>\"One of the most unique bed and breakfasts I have ever visited…Anyone who enjoys frogs, geese, comforters, good books, art and delightful proprietors will thoroughly enjoy the Goose & Turrets.\" <em>San Diego Union</em></p>";

testimonial[3] = "<p><strong>\"A B&B that reminds me of European inns…a good base for visiting San Francisco or Carmel.\" <em>Los Angeles Times</em></strong></p>";

testimonial[4] = "<p><strong>\"This bed & breakfast is 'THE' model for the industry…There is a real feeling of being at home here.\" <em>RR, Monterey, CA</em></strong><br><br>\"This is what a B&B should be - we enjoyed.\" <em>AMcG, Canoga Park, CA</em><br><br>\"This is the only place we have ever stayed that has offered to leave us breakfast when we've had to depart earlier than the scheduled meal. It was delightful.\" <em>J & CJ, Watkinsville, GA</em><br><br>\"Thank you for the mugs. I really like them. We are reddy used them, too. I had a good time there.\" <em>PB (age 7), Concord, CA</em><br><br>\"I've enjoyed myself tremendously. This is five yens coin.\" <em>MH, Kawasakishi, Japan</em></p>";

testimonial[5] = "<p><strong>\"We're not even inclined to try out anywhere new, we always know we'll be relaxed and well cared for here.\" <em>KH, San Jose, CA</em></strong><br><br>\"A delightful night. We were really made to feel at home in such a charming house. Thank you Emily, Raymond, and Dominique.\" <em>N & MD, Palo Alto, CA</em></p>";

testimonial[6] = "<p><strong>\"Loved the books and the chocolate!\" <em>S & JK, Herndon, VA</em></strong><br><br>\"We thoroughly enjoyed our two nights here. Very comfortable and excellent food. Super place.\" <em>B & JB, Ontario, Canada</em><br><br>\"Quiet and nice. Gracias; nos gusto mucho.\" <em>JC, San Francisco, CA</em><br><br>\"Enjoyed the weekend, especially the antiques and the breakfasts.\" <em>C & MV, Saratoga, CA</em><br><br>\"Thanks for everything! We appreciated all your thoughtful touches and breakfast was wonderful!\" <em>NL, Wakefield, RI</em></p>";

testimonial[7] = "<p><strong>\"Perfect antidote to city living. Thank you for ever gracious hospitality.\" <em>MP, Santa Monica, CA</em></strong><br><br>\"Cozy, great bed, roomy, nice reading by the fire.\" <em>S & JT, Atlanta, GA</em><br><br>\"Our private piece of paradise.\" <em>RW, San Carlos, CA</em></p>";

testimonial[8] = "<p><strong>\"The hosts, the food, the garden, the guests, the ambiance - Bravo!\" <em>J & J McM, Groves Beach, CA</em></strong><br><br>\"It's a miracle out of the hundreds of possibilities, Jerry could awake in the Clipper room on his birthday. Almost as good as a plane ride. Nice details, we loved the cloud wall and blue, blue sky.\" <em>P & JC, Fairfax, CA</em></p>";
		
	//random number generator
	function randomNumber(n) {
	number = Math.floor(Math.random() * (n + 1));
	return number;
	}
	
	
//opens popup window to view rooms */
function openRoomWin(aURL) {
var openWin = window.open(aURL,"room_win","resizable=1,location=1,status=1,menubar=1,toolbar=1,scrollbars=1,width=600,height=620,left=400,top=150,screenX=0,screenY=0");
openWin.opener = window;

openWin.focus();
}
