//photo captions
var caption = new Array();
caption[1] = "Brad Lashua";
caption[2] = caption[3] = caption[4] = caption[5] = "Bart Rulon";
caption[6] = caption[7] = "Jami Nagel";
caption[8] = caption[9] = caption[10] = "Kate Janes";
caption[11] = caption[12] = caption[13] = "Terry Bare";

function initBannerFade(){
    var banner = document.getElementById("banner");
    var photocredit = document.getElementById("photocredit");
    var n = caption.length-1;
    var ph = genRand(n);
    photocredit.innerHTML += "Photo Credit: " + caption[ph];
    banner.innerHTML = "<img src=\""+path+"img/photo"+ph+".jpg\" width=\"960\" height=\"217\" alt=\"\" id=\"bannerphoto\" />" + banner.innerHTML;
    var image = document.getElementById("bannerphoto");
    setOpacity(image, 0)
    image.style.visibility = 'visible';
    fadeIn("bannerphoto",0);
    
    var bannerwrap = document.getElementById("wrap");
    var phs=genRand(10);    
    bannerwrap.innerHTML += "<div id=\"photostrip\"><img src=\""+path+"img/photostrip"+phs+".png\" width=\"960\" height=\"169\" alt=\"\" /></div>";
}

function setOpacity(obj, opacity) {
  opacity = (opacity == 100)?99.999:opacity;
  // IE/Win
  obj.style.filter = "alpha(opacity:"+opacity+")";
  // Safari<1.2, Konqueror
  obj.style.KHTMLOpacity = opacity/100;
  // Older Mozilla and Firefox
  obj.style.MozOpacity = opacity/100;
  // Safari 1.2, newer Firefox and Mozilla, CSS3
  obj.style.opacity = opacity/100;
}

function fadeIn(objId,opacity) {
  obj = document.getElementById(objId);
  if (opacity <= 100) { 
    setOpacity(obj, opacity);
    opacity += 5;
    window.setTimeout("fadeIn('"+objId+"',"+opacity+")", 40);
  }
}

function genRand(x) {
    var range = x;
    return Math.floor(Math.random() * range) + 1;
}

//tesimonials
var testimonials = [
    ['This cruise was the most spectacular day of our vacation. The crew was very helpful, knowledgeable, and kind. And all the scenery was beautiful&mdash;the eagles, the harbor seals, and all the whales. Pat and I highly recommend this cruise!!','Steve and Pat from Chiefland, FL'],
    ['I was on your whale watching tour on September 26, 2007. It was the most incredible day and I would like to extend a big thank you to all your employees. They were fantastic and the day couldn&rsquo;t have been more successful. I have told many people about our experience. They plan on booking with your company in the future.','Sylvia O.'],
    ['I want to thank you for the wonderful tour my daughter and I took with Island Adventures.  Your staff were outstanding and made our tour the highlight of my vacation. We saw J, K and some of L pods. The Orcas gave us a show to remember!  We will be back next year. We&rsquo;ve already marked our calendars!','Alice V. from St. Louis, MO'],
    ['We wanted to share photos from our trip 9/14.  We had an AWESOME time.  The new Island Explorer III is a beautiful boat! Keep up the terrific work&hellip; we will be back again!','Ron &amp; Cheri T. and Bob &amp; Pam J.'],
    ['Thank you for another wonderful day on the water. What a knockout line up: orcas, a minke, stellar sea lions, harbor seals, eagles, harbor porpoise, turkey vulture. Pretty darn cool. And Captain Shane the naturalist! That was a first for me. What fun.','Annette C.'],
    ['This was my husbands&rsquo; and my 15th anniversary celebration trip and it couldn&rsquo;t have gone better.  We were so impressed with your staff, that we will be back every year at least 1 time.  Unfortunately, we live in Portland, Oregon, so it takes us time to get up here, but it will be worth the while.&hellip;  Again, thank you for such a great time and a memory that will last a lifetime.','Wayne J. from Portland, OR'],
    ['Today I went on your 9 am tour and want to tell you a wonderful trip it was. I have lived in the Pacific NW for 18 years and have always wanted to go whale watching, but was &ldquo;waiting&rdquo; to go with someone. I decided to give myself a birthday present and went by myself. I went out with a heavy heart. But as I stood at the bow of the boat, almost the entire trip, my soul was soothed to be out in the open water with the wind, fresh air, beautiful scenery, and of course the wildlife, particularly the whales. They made me squeal like a little girl. Thank you to the crew for an awesome day!!!','Christine R. from Kent, WA'],
    ['One of the reasons we always chose Island Adventures is we know they are respected for their adherence to whale watching regulations and have a sound &ldquo;green&rdquo; policy.  We were first introduced to you by People For Puget Sound, and have been out, always with you, several times since.','Barbara L. from Camano Island, WA'],
    ['Thanks for running a terrific operation.  Thanks for knowing that being generous with time, when one of nature&rsquo;s great dramas is being played out, is more important than watching the clock.  We&rsquo;ll go whale watching again.  Will it be with Island Adventures?  Emphatically, yes!','Barbara L. from Camano Island, WA'],
    ['This is our second cruise this summer.  Didn&rsquo;t think the second could be as good as the first.  WRONG.  It was so different.  Different boat, different crew, different whales, different weather&hellip;different WONDERFUL caring crew that made each one feel like they were special from the front desk when we checked in (bought jackets for all and Christmas tree ornaments) to the hand shake at the end&hellip;again, we WILL be back with more people&hellip; Thanks again for the great day.','Jan &amp; Norman P.'],
    ['I just wanted to thank you again for the wonderful whale watching adventure we (myself and two grandsons) had on Friday, June  29th.   We went out at Noon and had the opportunity to see many of the J Pod Orcas&mdash;they  were so  beautiful and the crew made the experience overwhelming with  their knowledge  and abilities&hellip;from the information about some of the wildlife we saw on the way to the Pod and then the  able way that the Captain moved the boat to get the best views of the Orcas&hellip;it was just something spectacular.   I have been wanting to go whale watching for so many years and now my dream has come true!   I will gladly refer folks to you so that they can have a great experience too.  &ldquo;Thank you&rdquo; seems inadequate but it is from the heart!','Sue Z. and grandsons'],
    ['We just wanted to say thank you for the great trip.  We got to see the orca&rsquo;s the way nature intended them to be&mdash;free&mdash;and it was amazing.  The crew was wonderful and went out of there way to make sure we saw all wild life.&hellip;  Thank you once again for a life time memory.','Tammy &amp; Dennis from Everett, WA'],
    ['Hello. I would just like to send a little note to let you know how much we LOVED our trips with your company. We first would like to say your crew is spectacular. Captain Carl worked so hard especially on the second day to get us out to the whales!!!! Your staff was polite, very knowledgeable and the tours were AWESOME!!! We would recommend your company to anyone and will definitely tell everyone we know about your company!!!!! We couldn&rsquo;t have asked for a better time aboard your ship!! The whales were awesome and we have great memories to last us a lifetime!!!!! I can&rsquo;t really put into words what a wonderful time we had&hellip;it just doesn&rsquo;t say enough. Thanks again for such a great experience!!!!!   Hope to see you all again!!!=)','Scott, Amy, Shilo and Aeryn W. from Billings, MT'],
    ['We want to again express our gratitude for a most wonderful day.  The trip was way more than we expected.  You went overboard (pun intended) to give everyone the best possible experience.  Your staff are great.  They made everyone feel that they were the only people on board.  You took little side stops so we could all see everything possible. We have spent many summers in the waters from Anacortes to Desolation Sound and have seen many of the animals we saw Monday.  You made it all new again.  I could go on and on, but by now you get the drift of our feelings.  Our family is coming from California this July so we WILL be back in force with you.  We want to be on your boat with the same crew as you have totally spoiled us.   Thanks so much again for a wonderful day.','Norman and Jan P. from Redmond, WA'],
    ['I have now returned to Wisconsin and want to thank you for the wonderful time we had whale-watching.  Your crew was exceptionally friendly, interesting and helpful.  They played a large part in making the trip such a success. I&rsquo;ve been on many trips but never felt so comfortable with the providers.  Thanks again.','Barbara I. from Wisconsin'],
    ['I would like to thank you for the awesome trip!  Before we set out on our trip from Wisconsin to Washington we had called to book our whale watching trip.  Sam had answered the phone, and had informed us not only of Island Adventures but also information of the area, with lodging and restaurant information.  He went out of his way to help us. Once we arrived we had a fantastic trip! The captain and other staff on the Island Explorer were accommodating and entertaining. We saw more than promised by your staff, and have wonderful memories.','Mike &amp; Linda Lee W. from Wisconsin'],
    ['THANK YOU for a wonderful cruise on our whale watching tour. The crew was great&mdash;they were fun, helpful, knowledgeable, attentive, and just&hellip;great! We will most definitely consider you when whale watching comes up again for our July Meeting. It was a terrific experience and folks are raving about it.','Bonnie B. from WA &amp; Northern ID District Council of Laborers'],
    ['We wanted to express our thanks to you and your crew for a very successful cruise. We really appreciated everyone&rsquo;s efforts and wanted to especially say thanks to Drew and Brooke; they both did an exceptional job making our guests feel special. Thanks for everything, and we look forward to next year.','Viviano G. and Mary K. from Ferndale, WA'],
    ['I would like to thank you for a truly amazing tour on August 19, 2007 aboard the Island Explorer 3. This was the most beautiful boat I have ever been on! I thought the captain was hilarious and the crew was terrific! I really enjoyed meeting your naturalist Bart Rulon, and was very excited to purchase some of his photography in your shop! This tour was definitely the biggest highlight of my vacation. I will be sure to come back to tour with you next summer!','Barbara B. from Lady Lake, FL'],
    ['Wow! What a show! The captain and crew were great and so knowledgeable about the local wildlife and orca whales. This was my third time out and on the afternoon trip we seemed to stop in the middle of 3 pods. They were all around the boat. About the Explorer 3&mdash;what a great boat. The set up is just perfect. Extra seating all around. Nice snack bar area for the crew and all. At the end of our tour, the captain himself took our picture at the bow of the boat from the dock. I thought I would see one&mdash;instead we saw so many more. Amazing! Thanks so much. Orca whales do exist!!','Gloria from Mt. Vernon, WA'],
    ['Just wanted to thank you for the wonderful sunset cruise last Saturday (4/26/08). My children and I loved every second of it! Shane, Kate and Brooke were fantastic&mdash;so knowledgable about the wildlife, especially the whales. But more importantly, they were so enthusiastic about what we were seeing. It&rsquo;s hard to believe that they experience these things every day and yet are still so in awe. They gasped and cheered with the rest of us every time those whales surfaced or made a move. We have not stopped talking about it &mdash;even my teenagers! We can&rsquo;t wait to come back. Thanks for everything&mdash;it was perfect in every way!!!','Judy M. from Frankfort, IL'],
    ['We had a wonderful time. I wanted to personally thank Kate, our naturalist, though. She was so wonderful. She truly made the trip stand out in my mind from the many I&rsquo;ve taken. I&rsquo;ve traveled the country (and parts of the world) whale watching, but I&rsquo;d never experienced a crew as lovely as yours! If it were possible, would you pass this message along to our naturalist in particular? I also plan on joining you in early May to see Pacific Coast resident Orcas for the first time in my life! Thank you all once again!', 'Tori H.'],
    ['I went on a cruise today, Saturday (4/5), and just wanted to thank you for such a great trip.  I grew up in the Puget Sound area and had never seen a gray whale until today.  I got to see at least 4!!!!It was a great trip and I was impressed with the knowledge and friendliness of the crew.  I also chose your company because I heard from my friends that you comply with the rules and don&rsquo;t get too close to the whales.  You ran a tight ship.','Samantha E. from Seattle, WA'],
    ['We arrived home after an unanticipated treat watching the first humpback of the season (4/18/2011). The enthusiasm on the boat was, to say the least, incredible. Those of us on the boat, including the crew, became simply giddy when the whale breached; not once, not twice, but maybe ten times.<br /><br />I would highly recommend this adventure. The crew was professional, enthusiastic and flexible. I only hope you can have the same wonderful experience as did we.','Alan Gardner from Somers, NY'],

	['Wow!!! Words Can&rsquo;t even express how AWESOME of a time we had! Knocked the socks off ANY New England whale watch we&rsquo;ve done! Crew was so friendly, knowledgeable, and personal. Thank you, Thank you, Thank you, Thank You and Thank you from all of us. Kicked off our vacation with a&hellip;memory for a lifetime!!!','Ted Federo'],
	['Spectacular experience on the water witnessing the superpod on Friday! My friend from Minnesota was elated and immensely grateful for such a grand experience, as was I&hellip;front row seats to a display of perfect wild freedom! Thank you to Captain Carl and Brooke for their expertise in what turned out to be the most incredible day! Whales galore!','Maureen M.'],
	['I wanted to thank you so much for the amazing afternoon and evening. Captain Mike and crew outdid themselves! We were amazed by the number of orca sightings and by the crew&rsquo;s dedication to pursuing the whales until we caught up with them. I was also impressed by the boat itself &mdash; clean, roomy and plenty of railing space for viewing. I&rsquo;m only 5\'3" but I never felt as if I couldn&rsquo;t see something because someone was crowding me out. I was even impressed by how reasonable the prices at your concession counter are. I mean, let&rsquo;s face it, we&rsquo;re hours out to sea&ehllip;you could charge whatever you want because we really don&rsquo;t have an option. But the prices were not at all outrageous. I think that shows a measure of respect for your customers. Our day with Island Adventures was really the highlight of our Seattle trip. Thanks again for a job WELL DONE!','Cyndie Cox + Peg Spellman, Orlando, FL'],
	['I just wanted to send a note to thank Captain Mike, Brooke and Tyson for a wonderful day! It was truly amazing have a &quot;triple threat&quot; day!! Minke, humpback and orca&quot;s all in one day!! It was a once in a lifetime site to see all the orca&quot;s today. I feel very blessed! Thanks again!','Bernadette Dean, Ashland, Kentucky'],
	['I can not put into words what a great experience that was. For someone that does not live on the water it was breath taking at every turn and was an adventure that I will never forget. The idea for the proposal was something I have been thinking about for a long time but it worked out even better then I thought it could of. Thanks again for giving me the the opportunity to make this happen and I would love to do it again next year.</p><p>P.S. Just an FYI I must have told over 20 people today to check out Island Adventures for the best Whale watching in the NW.','Scot Steffy'],
	['Our trip on 9/9/11 couldn&rsquo;t have been any better. My husband and I have been on many, many whale watching trips on both the east and west coast of our great country. Our trip w/ Captain Michael was by far, the best we&rsquo;ve experienced in recent years. He and his crew were professional, friendly and approachable and certainly entertained us for almost 6 hours. We saw a plethora of wildlife from stellar sea lions, harbor seals, numerous pelagic birds, some harbor dolphins and A LOT of orcas. Was truly a delightful trip which we thoroughly enjoyed.','Lori Moak-Kean'],	
	['We took our annual whale spotting romp with you in mid-August. Of course, the whole crew; from the booking agent to the staff on the ship were wonderful. That&rsquo;s one of the great things that keeps us coming back! This year we took two dear friends from Oregon with us. They had never been whale watching, and had no idea what to expect. What a terrific show the whales put on. It was &ldquo;the gathering&rdquo; before they took off to follow the salmon. We did an afternoon cruise, and the numerous dorsal fins knifing the water while the sunset put on a beautiful display was a memorable moment. It&rsquo;s been over a month since we did this, and you may wonder why I&rsquo;m contacting you now.</p><p>On this trip, once again Capt&rsquo;n Carl displayed his determination that his guests would see a show, and see we did. Do you ever wonder if the experience you provide people is more than just an afternoon&rsquo;s diversion? Do you wonder if the impact of the beauty of the wildlife and the area are truly appreciated? Do you wonder if people &ldquo;get it&rdquo;?</p><p>I spoke with our Oregon friends last night, and of course, we had lots of catching up to do. I want to share with you what our friend said. He stopped in the midst of our giggle-fest and said, &ldquo;I want to tell you something. That last trip up to visit you? The whales, the sunset, the beauty of the moon rising while the whales were gathering....when I think of it I still get the chills.&rdquo; So there is your answer. Please know that going the extra mile does make a difference, and does create an experience and appreciation of the beauty of the Orcas that resonates beyond the day, or week, and forms a cherished lifetime memory.','Barbara Libby'],
	['I just wanted to let you guys know how amazing our trip was! Thank you for such an awesome tour and for making our Seattle vacation forever memorable.','The Ciolettis'],
	['I had the pleasure of sailing with you yesterday to celebrate my daughter&rsquo;s 24th birthday. I must say I was very impressed with how fun, engaging, and informative your crew was. I have attended other such tours, but this by far exceeded my expectations in quality and enjoyment. Captain Carl, Mike &amp; Tyson were so fun, helpful and made this an exciting adventure all around. We sailed for aprox. 6 hours, but it felt like only 2. It was not only educational, but entertaining as well. Needless to say, we had a great time and look forward to doing this again.</p><p>I also work at Tulalip Resort Casino (in the hotel, as a reservation agent). I will be recommending you to any and all of our guests &amp; travelers who are looking for something fun to do in this area. I will definitely inform our concierge service of your business as well.</p><p>Thank you again for such a wonderful time.','Alisa Rahkonen'],
	['Just a note to say thank you for our wonderful trip out to watch whales. Your marine biologist was so informative and all your crew were friendly and helpful. My husband and I thoroughly loved every minute we spent on your boat&mdash;it was the highlight of our trip to Seattle. Hope we can send our friends your way.','Sue and Jim Boykin, Marietta, GA'],
	['I just want to let you know how much we all enjoyed the Whale Watch Trip on Thursday, September 22, 2011. We had a fantastic time and a memorable day. Thank you.</p><p>We have nothing to say but good things &mdash; from the time we arrived at the check in office and received a warm welcome, until the time we docked at the end of the trip, when the Captain and his staff, helped us off the boat, thanked us and wished us a safe drive home.</p><p>What began as an overcast and rainy day, turned into a wonderfully clear and sunny day with exceptionally calm seas!</p><p>The staff were all very pleasant, informative and shared their knowledge and information on the whales - boy, did we see lots of whales. I was just &ldquo;hoping&rdquo; to see a whale &mdash; we saw many!! This trip met our expectations and surpassed it by a mile!! It was phenomenal!! Not only the whale watch was great &mdash; so was the boat crew! They helped make our day so enjoyable. Also the snack bar was well stocked with hot &amp; cold food &amp; drinks, plus a very good selection of other snacks &mdash; very reasonably priced. It was a tad nippy on the water, so the hot chocolate was very welcome!</p><p>So, this was a really special day for us and one we had looked forward to &mdash; it was more than we could have imagined! From start to finish it was a wonderful, fun experience and we thoroughly enjoyed it. We came thousands of miles to take this trip and it was certainly worth it!! We would definitely highly recommend it to others.</p><p>Thank you all for making it a memorable day!','Maureen Smith (&amp; James Smith, Nick Gladdy)'],
	['My Aunt (from Florida) and I (from Bellingham) went out in search of wild life with Island Adventures on Oct. 2, 2011. It was a cold and extremely foggy day, with heavy fog even an hour out. We started to wonder of we chose the wrong time of year to go in search of whales&hellip;boy, were we wrong!! OMG We saw roughly 60 Orca!! Some members from all three resident pods. The Orcas were very active: playing, feeding, resting and even mating. There were lots of eye spying, tail slaps, porpoising, etc. We got the most fabulous pictures! The captain did an amazing job of finding the pods then maneuvering the boat as close to the pod as we were allowed and traveled with the pod for quite some time, allowing us to watch the natural interaction and activity of these beautiful mammals (who, as we learned from the Naturalist on board, are actually dolphins!) Many thanks to the wonderful staff and crew for making our entire experience with Island Adventures fabulous!','Kimber Mieras, Bellingham, WA'],
	['I took your 12:00 noon Whale watching Cruise today, and I cannot express how wonderful it was. the crew was very friendly and knowledgeable. the boat was very clean and comfortable. I was recommended to Island Adventures by a friend who took the same cruise last year, and my experience definitely surpassed my expectations. I will be recommending Island Adventures to anyone I know of who travels out to Washington. I have been visiting in Seattle since Sunday, and today was the most relaxing day of my trip so far. The scenery in and around the San Juan Islands was just fantastic, and the wildlife viewing (especially the Orca whales) was top notch. this trip will probably go down as the most memorable part of my trip out to Washington. A heartfelt thanks to you and your crew, for such a fantastic experience.','Chris Stack, Oshkosh, Wisconsin'],
	['Our trip with Island Adventures on Sept. 22 was spectacular, and was highlight of our recent visit to The Great Northwest!</p><p>Your staff was superb from the moment we entered the store right through our disembarking the vessel. My wife required a wheelchair to participate in this adventure and Capt Mike, Brooke &amp; Tyson were outstanding in their efforts to make her feel comfortable and relaxed during this trip. We enjoyed everything about this trip and HIGHLY RECOMMEND ISLAND ADVENTURES to anyone who is considering a whale watching adventure.</p><p>Thanks you and your team for providing us with a First Rate experience.','Rich Fanning, Bluffton, SC'],
	['We had the pleasure of doing your whale tour on Saturday, October 9th. We had a wonderful time. I am in customer service and the whole crew went above and beyond customer service, from getting me a wheel chair to answering questions. It&rsquo;s been a while since we have had such a wonderful experience.','Bob &amp; Peggi, Bremerton, WA'],
	['We took your cruise out of Everett this past Friday. It was everything you said it would be and more. We are familiar with the Everett Marina as we used to keep our boat there. First let me say, the vessel itself was immaculate.The captain and crew were obviously well trained and accommodating, both to the passengers and I might add, to the whales. Thank you very much for allowing us to view these magnificent animals under such comfortable circumstances. The whole experience was one we thoroughly enjoyed and will certainly recommend to others. We look forward to enjoying a cruise from Anacortes in the future.','Martin and Dotty Platzner, Sammamish, WA'],
	['I was on Saturday&rsquo;s morning AND afternoon whale watching adventure and enjoyed every minute of it. The crew was friendly, knowledgable, engaging and supportive. The Captain was all of those as well, but also possessed a photographer&rsquo;s eye &mdash; which helped me considerably as I am working on a photography project where capturing whale shots is a necessary component. He paid very good attention to providing us photographers natural backlight whenever possible so that we could use that to capture more detail in the whales we spotted. It&rsquo;s very rare indeed for individuals to be multi-disciplinary &mdash; in his case, skillfully piloting a vessel as well as possessing the eye of a photographer, being sensitive to what photographers both need and strongly desire in our shots. What&rsquo;s more, he delivered the goods: beautiful whale-watching opportunities for both the morning and afternoon trips. I truly had a &quot;whale&quot; of a time!','Bill Breneman'],
	['My sincere thanks to Capt Mike and crew on a spectacular cruise.</p><p>Whales to the left, whales to the right, under the boat, I fully expected one to jump the bow. Brooke&rsquo;s enthusiasm was infectious!</p><p>Having graduated as a marine biology major, 23 years ago, I&rsquo;ve had a number of wonderful whale-watching experiences. This trip ranked right up there!!</p><p>Attached is a photo I took during the pass of three whales at the stern. Un-cropped and with a 85mm NIKKOR lens, this &rsquo;portrait&rsquo; of a whale was my favorite photo!</p><img src="../img/201111-testimonial.jpg" width="400" height="268" alt="" />','Joseph Y. de Jesus, Tumwater, WA']
]

var path = "../";

function initTestimonial(){
    var n=genRand(testimonials.length);
    var testimonial = document.getElementById("testimonial");
    var content = "<p class=\"quote\">"+testimonials[n-1][0]+"</p>\n";
    content += "<p class=\"attr\">"+testimonials[n-1][1]+"</p>\n";
    content += "<p class=\"more\"><a href=\""+path+"about/testimonials.php\">Read more testimonials&hellip;</a></p>\n";
    testimonial.innerHTML = content;
}

function initSubnav(){
    var subnav = document.getElementById('sectionnav');
    var subnavas = subnav.getElementsByTagName('a');
    for (var a=0; a<subnavas.length; a++){
        var currenthref=String(subnavas[a].href);
        var currentloc=String(document.location);
        if (unescape(currenthref)==unescape(currentloc)){
            subnavas[a].className="current"
        }
    }
}

function initDatePop(){
    var dp = document.getElementById('datepop');
    addAnEvent(dp,'click',getdate);
}

function initWebcamPop(){
    var w = document.getElementById('webcam');
    var was = w.getElementsByTagName('a');
    for (var a=0; a<was.length; a++){
        addAnEvent(was.item(a),'click',WebcamPop);
    }
    
}

function WebcamPop(){
        appWindow = window.open (this.href,"appWindow","width=660,height=500,toolbar=0,resizable=1");
        appWindow.focus ();
        return false;        
}

function initLinks(){
    var content = document.getElementById('wrap');
    var links = content.getElementsByTagName('a');
    
    for(var i=0;i<links.length;i++){
        var linky = links[i];
        if (linky.className == "recording") {
            addAnEvent(links.item(i),'click',RecWindow);
        } else if (linky.className == "dotmap") {
            addAnEvent(links.item(i),'click',MapWindow);
        }
    }
}

function RecWindow(){
        appWindow = window.open (this.href,"appWindow","width=200,height=200,toolbar=0,resizable=1");
        appWindow.focus ();
        return false;        
}

function MapWindow(){
        appWindow = window.open (this.href,"appWindow","width=570,height=660,toolbar=0,resizable=1");
        appWindow.focus ();
        return false;        
}

function initialize(){
    if ( document.getElementById ){  
        if (document.getElementById("home") || document.getElementById("e404")) path = "";
        if (document.getElementById("banner") && !document.getElementById("gallery") && !document.getElementById("visitor_map")) initBannerFade();
        if (document.getElementById("sectionnav")) initSubnav();
        if (document.getElementById("datepop")) initDatePop();
        if (document.getElementById("webcam")) initWebcamPop();
        initLinks();
        if (document.getElementById("testimonial")) initTestimonial();  
        if (document.getElementById("reserve") || document.getElementById("visitor_map")) initPageAux();
    }
	if (!document.getElementById("reserve")){
	$(".video a").fancybox({
		'width'				: 560,
		'height'			: 340,
		'autoScale'			: false,
		'type'				: 'iframe',
		'overlayOpacity'	: 0.95,
		'overlayColor'		: '#2660a3'
	});
	}
	
	$('#n-tours').hover(		
		function() {$(this).children().slideDown('fast');},
		function() {$('ul', this).slideUp('fast');}
	);
	
	$('#slideshow').slides({
			preload: true,
			preloadImage: '../img/ss/loading.gif',
			generateNextPrev: true,
			play: 5000,
			slideSpeed: 750,
			pause: 2500,
			hoverPause: true,
			animationStart: function(current){
				$('.caption').animate({
					bottom:-41
				},100);
			},
			animationComplete: function(current){
				$('.caption').animate({
					bottom:0
				},200);
			},
			slidesLoaded: function() {
				$('.caption').animate({
					bottom:0
				},200);
			}
		});
}

function addAnEvent( target, eventName, functionName){
   eval('target.on'+eventName+'=functionName');
}

function BrowserDetect() {
   var ua = navigator.userAgent.toLowerCase(); 

   // browser name
   this.isOpera       = (ua.indexOf('opera') != -1); 
   this.isIE          = (ua.indexOf('msie') != -1 && !this.isOpera && (ua.indexOf('webtv') == -1) ); 
   
   // browser version
   this.versionMinor = parseFloat(navigator.appVersion); 
   
   // correct version number
   if (this.isIE && this.versionMinor >= 4) {
      this.versionMinor = parseFloat( ua.substring( ua.indexOf('msie ') + 5 ) );
   }
   
   this.versionMajor = parseInt(this.versionMinor); 

   // platform
   this.isWin    = (ua.indexOf('win') != -1);
   this.isWin32  = (this.isWin && ( ua.indexOf('95') != -1 || ua.indexOf('98') != -1 || ua.indexOf('nt') != -1 || ua.indexOf('win32') != -1 || ua.indexOf('32bit') != -1 || ua.indexOf('xp') != -1) );
   
   // specific browser shortcuts
   this.isIE55 = (this.isIE && this.versionMinor == 5.5);
   this.isIE6x = (this.isIE && this.versionMajor == 6);
}
var browser = new BrowserDetect();

function getdate(){
    window.open('../mini_calendar_book.cfm?FormName=bookonline&FieldName=idate','cal','width=400,height=400');
}

window.onload=initialize;


