
(function($){$.prettyPhoto={version:'2.5.4'};$.fn.prettyPhoto=function(settings){settings=jQuery.extend({animationSpeed:'normal',padding:40,opacity:0.80,showTitle:true,allowresize:true,counter_separator_label:'/',theme:'light_rounded',hideflash:false,modal:false,changepicturecallback:function(){},callback:function(){}},settings);if($.browser.msie&&$.browser.version==6){settings.theme="light_square";}
if($('.pp_overlay').size()==0){_buildOverlay();}else{$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');}
var doresize=true,percentBased=false,correctSizes,$pp_pic_holder,$ppt,pp_contentHeight,pp_contentWidth,pp_containerHeight,pp_containerWidth,pp_type='image',setPosition=0,$scrollPos=_getScroll();$(window).scroll(function(){$scrollPos=_getScroll();_centerOverlay();_resizeOverlay();});$(window).resize(function(){_centerOverlay();_resizeOverlay();});$(document).keydown(function(e){if($pp_pic_holder.is(':visible'))
switch(e.keyCode){case 37:$.prettyPhoto.changePage('previous');break;case 39:$.prettyPhoto.changePage('next');break;case 27:if(!settings.modal)
$.prettyPhoto.close();break;};});$(this).each(function(){$(this).bind('click',function(){link=this;theRel=$(this).attr('rel');galleryRegExp=/\[(?:.*)\]/;theGallery=galleryRegExp.exec(theRel);var images=new Array(),titles=new Array(),descriptions=new Array();if(theGallery){$('a[rel*='+theGallery+']').each(function(i){if($(this)[0]===$(link)[0])setPosition=i;images.push($(this).attr('href'));titles.push($(this).find('img').attr('alt'));descriptions.push($(this).attr('title'));});}else{images=$(this).attr('href');titles=($(this).find('img').attr('alt'))?$(this).find('img').attr('alt'):'';descriptions=($(this).attr('title'))?$(this).attr('title'):'';}
$.prettyPhoto.open(images,titles,descriptions);return false;});});$.prettyPhoto.open=function(gallery_images,gallery_titles,gallery_descriptions){if($.browser.msie&&$.browser.version==6){$('select').css('visibility','hidden');};if(settings.hideflash)$('object,embed').css('visibility','hidden');images=$.makeArray(gallery_images);titles=$.makeArray(gallery_titles);descriptions=$.makeArray(gallery_descriptions);if($('.pp_overlay').size()==0){_buildOverlay();}else{$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');}
$pp_pic_holder.attr('class','pp_pic_holder '+settings.theme);isSet=($(images).size()>0)?true:false;_getFileType(images[setPosition]);_centerOverlay();_checkPosition($(images).size());$('.pp_loaderIcon').show();$('div.pp_overlay').show().fadeTo(settings.animationSpeed,settings.opacity,function(){$pp_pic_holder.fadeIn(settings.animationSpeed,function(){$pp_pic_holder.find('p.currentTextHolder').text((setPosition+1)+settings.counter_separator_label+$(images).size());if(descriptions[setPosition]){$pp_pic_holder.find('.pp_description').show().html(unescape(descriptions[setPosition]));}else{$pp_pic_holder.find('.pp_description').hide().text('');};if(titles[setPosition]&&settings.showTitle){hasTitle=true;$ppt.html(unescape(titles[setPosition]));}else{hasTitle=false;};if(pp_type=='image'){imgPreloader=new Image();nextImage=new Image();if(isSet&&setPosition>$(images).size())nextImage.src=images[setPosition+1];prevImage=new Image();if(isSet&&images[setPosition-1])prevImage.src=images[setPosition-1];pp_typeMarkup='<img id="fullResImage" src="" />';$pp_pic_holder.find('#pp_full_res')[0].innerHTML=pp_typeMarkup;$pp_pic_holder.find('.pp_content').css('overflow','hidden');$pp_pic_holder.find('#fullResImage').attr('src',images[setPosition]);imgPreloader.onload=function(){correctSizes=_fitToViewport(imgPreloader.width,imgPreloader.height);_showContent();};imgPreloader.src=images[setPosition];}else{movie_width=(parseFloat(grab_param('width',images[setPosition])))?grab_param('width',images[setPosition]):"425";movie_height=(parseFloat(grab_param('height',images[setPosition])))?grab_param('height',images[setPosition]):"344";if(movie_width.indexOf('%')!=-1||movie_height.indexOf('%')!=-1){movie_height=($(window).height()*parseFloat(movie_height)/100)-100;movie_width=($(window).width()*parseFloat(movie_width)/100)-100;percentBased=true;}
movie_height=parseFloat(movie_height);movie_width=parseFloat(movie_width);if(pp_type=='quicktime')movie_height+=15;correctSizes=_fitToViewport(movie_width,movie_height);if(pp_type=='youtube'){pp_typeMarkup='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="http://www.youtube.com/v/'+grab_param('v',images[setPosition])+'" /><embed src="http://www.youtube.com/v/'+grab_param('v',images[setPosition])+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';}else if(pp_type=='quicktime'){pp_typeMarkup='<object classid="clsid:02BF25D5-8C17-4B23-BC80-D3488ABDDC6B" codebase="http://www.apple.com/qtactivex/qtplugin.cab" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'"><param name="src" value="'+images[setPosition]+'"><param name="autoplay" value="true"><param name="type" value="video/quicktime"><embed src="'+images[setPosition]+'" height="'+correctSizes['height']+'" width="'+correctSizes['width']+'" autoplay="true" type="video/quicktime" pluginspage="http://www.apple.com/quicktime/download/"></embed></object>';}else if(pp_type=='flash'){flash_vars=images[setPosition];flash_vars=flash_vars.substring(images[setPosition].indexOf('flashvars')+10,images[setPosition].length);filename=images[setPosition];filename=filename.substring(0,filename.indexOf('?'));pp_typeMarkup='<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"><param name="allowfullscreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="movie" value="'+filename+'?'+flash_vars+'" /><embed src="'+filename+'?'+flash_vars+'" type="application/x-shockwave-flash" allowfullscreen="true" allowscriptaccess="always" width="'+correctSizes['width']+'" height="'+correctSizes['height']+'"></embed></object>';}else if(pp_type=='iframe'){movie_url=images[setPosition];movie_url=movie_url.substr(0,movie_url.indexOf('iframe')-1);pp_typeMarkup='<iframe src ="'+movie_url+'" width="'+(correctSizes['width']-10)+'" height="'+(correctSizes['height']-10)+'" frameborder="no"></iframe>';}
_showContent();}});});};$.prettyPhoto.changePage=function(direction){if(direction=='previous'){setPosition--;if(setPosition<0){setPosition=0;return;}}else{if($('.pp_arrow_next').is('.disabled'))return;setPosition++;};if(!doresize)doresize=true;_hideContent();$('a.pp_expand,a.pp_contract').fadeOut(settings.animationSpeed,function(){$(this).removeClass('pp_contract').addClass('pp_expand');$.prettyPhoto.open(images,titles,descriptions);});};$.prettyPhoto.close=function(){$pp_pic_holder.find('object,embed').css('visibility','hidden');$('div.pp_pic_holder,div.ppt').fadeOut(settings.animationSpeed);$('div.pp_overlay').fadeOut(settings.animationSpeed,function(){$('div.pp_overlay,div.pp_pic_holder,div.ppt').remove();if($.browser.msie&&$.browser.version==6){$('select').css('visibility','visible');};if(settings.hideflash)$('object,embed').css('visibility','visible');setPosition=0;settings.callback();});doresize=true;};_showContent=function(){$('.pp_loaderIcon').hide();if($.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth;}else{windowHeight=$(window).height();windowWidth=$(window).width();};projectedTop=$scrollPos['scrollTop']+((windowHeight/2)-(correctSizes['containerHeight']/2));if(projectedTop<0)projectedTop=0+$pp_pic_holder.find('.ppt').height();$pp_pic_holder.find('.pp_content').animate({'height':correctSizes['contentHeight']},settings.animationSpeed);$pp_pic_holder.animate({'top':projectedTop,'left':((windowWidth/2)-(correctSizes['containerWidth']/2)),'width':correctSizes['containerWidth']},settings.animationSpeed,function(){$pp_pic_holder.width(correctSizes['containerWidth']);$pp_pic_holder.find('.pp_hoverContainer,#fullResImage').height(correctSizes['height']).width(correctSizes['width']);$pp_pic_holder.find('#pp_full_res').fadeIn(settings.animationSpeed);if(isSet&&pp_type=="image"){$pp_pic_holder.find('.pp_hoverContainer').fadeIn(settings.animationSpeed);}else{$pp_pic_holder.find('.pp_hoverContainer').hide();}
$pp_pic_holder.find('.pp_details').fadeIn(settings.animationSpeed);if(settings.showTitle&&hasTitle){$ppt.css({'top':$pp_pic_holder.offset().top-20,'left':$pp_pic_holder.offset().left+(settings.padding/2),'display':'none'});$ppt.fadeIn(settings.animationSpeed);};if(correctSizes['resized'])$('a.pp_expand,a.pp_contract').fadeIn(settings.animationSpeed);if(pp_type!='image')$pp_pic_holder.find('#pp_full_res')[0].innerHTML=pp_typeMarkup;settings.changepicturecallback();});};function _hideContent(){$pp_pic_holder.find('#pp_full_res object,#pp_full_res embed').css('visibility','hidden');$pp_pic_holder.find('.pp_hoverContainer,.pp_details').fadeOut(settings.animationSpeed);$pp_pic_holder.find('#pp_full_res').fadeOut(settings.animationSpeed,function(){$('.pp_loaderIcon').show();});$ppt.fadeOut(settings.animationSpeed);}
function _checkPosition(setCount){if(setPosition==setCount-1){$pp_pic_holder.find('a.pp_next').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_next').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_next').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_next.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('next');return false;});};if(setPosition==0){$pp_pic_holder.find('a.pp_previous').css('visibility','hidden');$pp_pic_holder.find('a.pp_arrow_previous').addClass('disabled').unbind('click');}else{$pp_pic_holder.find('a.pp_previous').css('visibility','visible');$pp_pic_holder.find('a.pp_arrow_previous.disabled').removeClass('disabled').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});};if(setCount>1){$('.pp_nav').show();}else{$('.pp_nav').hide();}};function _fitToViewport(width,height){hasBeenResized=false;_getDimensions(width,height);imageWidth=width;imageHeight=height;windowHeight=$(window).height();windowWidth=$(window).width();if(((pp_containerWidth>windowWidth)||(pp_containerHeight>windowHeight))&&doresize&&settings.allowresize&&!percentBased){hasBeenResized=true;notFitting=true;while(notFitting){if((pp_containerWidth>windowWidth)){imageWidth=(windowWidth-200);imageHeight=(height/width)*imageWidth;}else if((pp_containerHeight>windowHeight)){imageHeight=(windowHeight-200);imageWidth=(width/height)*imageHeight;}else{notFitting=false;};pp_containerHeight=imageHeight;pp_containerWidth=imageWidth;};_getDimensions(imageWidth,imageHeight);};return{width:imageWidth,height:imageHeight,containerHeight:pp_containerHeight,containerWidth:pp_containerWidth,contentHeight:pp_contentHeight,contentWidth:pp_contentWidth,resized:hasBeenResized};};function _getDimensions(width,height){$pp_pic_holder.find('.pp_details').width(width).find('.pp_description').width(width-parseFloat($pp_pic_holder.find('a.pp_close').css('width')));pp_contentHeight=height+$pp_pic_holder.find('.pp_details').height()+parseFloat($pp_pic_holder.find('.pp_details').css('marginTop'))+parseFloat($pp_pic_holder.find('.pp_details').css('marginBottom'));pp_contentWidth=width;pp_containerHeight=pp_contentHeight+$pp_pic_holder.find('.ppt').height()+$pp_pic_holder.find('.pp_top').height()+$pp_pic_holder.find('.pp_bottom').height();pp_containerWidth=width+settings.padding;}
function _getFileType(itemSrc){if(itemSrc.match(/youtube\.com\/watch/i)){pp_type='youtube';}else if(itemSrc.indexOf('.mov')!=-1){pp_type='quicktime';}else if(itemSrc.indexOf('.swf')!=-1){pp_type='flash';}else if(itemSrc.indexOf('iframe')!=-1){pp_type='iframe'}else{pp_type='image';};};function _centerOverlay(){if($.browser.opera){windowHeight=window.innerHeight;windowWidth=window.innerWidth;}else{windowHeight=$(window).height();windowWidth=$(window).width();};if(doresize){$pHeight=$pp_pic_holder.height();$pWidth=$pp_pic_holder.width();$tHeight=$ppt.height();projectedTop=(windowHeight/2)+$scrollPos['scrollTop']-($pHeight/2);if(projectedTop<0)projectedTop=0+$tHeight;$pp_pic_holder.css({'top':projectedTop,'left':(windowWidth/2)+$scrollPos['scrollLeft']-($pWidth/2)});$ppt.css({'top':projectedTop-$tHeight,'left':(windowWidth/2)+$scrollPos['scrollLeft']-($pWidth/2)+(settings.padding/2)});};};function _getScroll(){if(self.pageYOffset){scrollTop=self.pageYOffset;scrollLeft=self.pageXOffset;}else if(document.documentElement&&document.documentElement.scrollTop){scrollTop=document.documentElement.scrollTop;scrollLeft=document.documentElement.scrollLeft;}else if(document.body){scrollTop=document.body.scrollTop;scrollLeft=document.body.scrollLeft;}
return{scrollTop:scrollTop,scrollLeft:scrollLeft};};function _resizeOverlay(){$('div.pp_overlay').css({'height':$(document).height(),'width':$(window).width()});};function _buildOverlay(){toInject="";toInject+="<div class='pp_overlay'></div>";toInject+='<div class="pp_pic_holder"><div class="pp_top"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div><div class="pp_content"><a href="#" class="pp_expand" title="Expand the image">Expand</a><div class="pp_loaderIcon"></div><div class="pp_hoverContainer"><a class="pp_next" href="#">next</a><a class="pp_previous" href="#">previous</a></div><div id="pp_full_res"></div><div class="pp_details clearfix"><a class="pp_close" href="#">Close</a><p class="pp_description"></p><div class="pp_nav"><a href="#" class="pp_arrow_previous">Previous</a><p class="currentTextHolder">0'+settings.counter_separator_label+'0</p><a href="#" class="pp_arrow_next">Next</a></div></div></div><div class="pp_bottom"><div class="pp_left"></div><div class="pp_middle"></div><div class="pp_right"></div></div></div>';toInject+='<div class="ppt"></div>';$('body').append(toInject);$('div.pp_overlay').css('opacity',0);$pp_pic_holder=$('.pp_pic_holder');$ppt=$('.ppt');$('div.pp_overlay').css('height',$(document).height()).hide().bind('click',function(){if(!settings.modal)
$.prettyPhoto.close();});$('a.pp_close').bind('click',function(){$.prettyPhoto.close();return false;});$('a.pp_expand').bind('click',function(){$this=$(this);if($this.hasClass('pp_expand')){$this.removeClass('pp_expand').addClass('pp_contract');doresize=false;}else{$this.removeClass('pp_contract').addClass('pp_expand');doresize=true;};_hideContent();$pp_pic_holder.find('.pp_hoverContainer, .pp_details').fadeOut(settings.animationSpeed);$pp_pic_holder.find('#pp_full_res').fadeOut(settings.animationSpeed,function(){$.prettyPhoto.open(images,titles,descriptions);});return false;});$pp_pic_holder.find('.pp_previous, .pp_arrow_previous').bind('click',function(){$.prettyPhoto.changePage('previous');return false;});$pp_pic_holder.find('.pp_next, .pp_arrow_next').bind('click',function(){$.prettyPhoto.changePage('next');return false;});$pp_pic_holder.find('.pp_hoverContainer').css({'margin-left':settings.padding/2});};};function grab_param(name,url){name=name.replace(/[\[]/,"\\\[").replace(/[\]]/,"\\\]");var regexS="[\\?&]"+name+"=([^&#]*)";var regex=new RegExp(regexS);var results=regex.exec(url);if(results==null)
return"";else
return results[1];}})(jQuery);



/*
====================================== */


jQuery.fn.fadeIn=function(speed,callback){return this.animate({opacity:'show'},speed,function(){if(jQuery.browser.msie)this.style.removeAttribute('filter');if(jQuery.isFunction(callback))callback()})};jQuery.fn.fadeOut=function(speed,callback){return this.animate({opacity:'hide'},speed,function(){if(jQuery.browser.msie)this.style.removeAttribute('filter');if(jQuery.isFunction(callback))callback()})};jQuery.fn.fadeTo=function(speed,to,callback){return this.animate({opacity:to},speed,function(){if(to==1&&jQuery.browser.msie)this.style.removeAttribute('filter');if(jQuery.isFunction(callback))callback()})};
	$(function () {
    var tabContainers = $('div#tabs > div');
    tabContainers.hide().filter(':first').show();
    $('div#tabs ul.tabNavigation a').click(function () {
      tabContainers.hide();
      tabContainers.filter(this.hash).show();
      $('div#tabs ul.tabNavigation a').removeClass('selected');
      $(this).addClass('selected');
      return false;
    }).filter(':first').click();
  });
  function hn(var_btn, var_info) {
    var $hide = ".nav_drpdwn";
    var $timer = "5000";
    var $btn = var_btn;
    var $info = var_info;
    var nameTxt = $(var_btn).html();
    $($info +' .drp_tab').html(nameTxt);
    $($hide).hide();
    $($btn).hover(function(){
      $($hide).hide();
      $($info).stop().show();
      $($info).mouseleave(function(){
        $($hide).hide();
      });
    });
  }
  function accd(){
    $(".accd h2").eq(0).addClass("active");
    $(".accd div:first").show();
    $(".accd h2").click(function(){
      $(this).next("div").slideDown("800").siblings("div:visible").slideUp("800");
      $(this).addClass("active");
      $(this).siblings("h2").removeClass("active");
      return false
    })
  }

window.onload = function() {
  var txtSearch= document.getElementById("search");
  if (txtSearch) {
    txtSearch.onfocus = function() {
      if(this.value == "Search the Site") {
        this.value = "";
        }
     }
    txtSearch.onblur = function() {
      if(this.value == "") {
       this.value = "Search the Site";
      } 
    }
  }
}

  function moveThing(){
    if(parseInt($('.sthldr_gallery_wrap').css('bottom')) == 0){
      $('.sthldr_gallery_wrap').animate({bottom:'-58px'}, 500);
    }
    else{
      $('.sthldr_gallery_wrap').animate({bottom:'0'}, 500);
    }
  }

  
  $(function(){
    if($("#tripReviews").length > 0){
    $("#tripReviews").load(stpath, {tripAdvisorInfo: true}, function(){
  });
    }
});
  var ns_lightbox_current = "";

$(window).load(function(){
  if($('#stlogo').length > 0){
    var normal_logo_ratio = 372.0/110.0;
    var stlogo_ratio = $('#stlogo').width() / $('#stlogo').height();
    if(stlogo_ratio > normal_logo_ratio){
      var height = 372/stlogo_ratio;
      var padding = (110-height)/2;
      $('#stlogo').css('padding-top', padding+'px');
      $('#stlogo').css('width','372px');
    }
    else{
      $('#stlogo').css({'height' : '110px'});
    }
  }
});
$(document).ready(function() {
  
  //---------------------------------------------------flickrGallery START------------------------------------------------//
  
  if($('.flickrgallery').length>0){
    createNsLightbox();
  }
  
  $('.flickrgallery a').click(function(){
    var bigimg = $(this).attr('href');
    var title = $(this).attr('title');
    var id = $(this).attr('id');
    $('#ns_lightbox_inner img').attr('src',bigimg);
    $('#ns_lightbox_title').html(title);
    ns_lightbox_current = id;
    showNsLightbox();
    return false;
  });
  
  $('#ns_lightbox_prev').click(function(){
    if($('#'+ns_lightbox_current).parent('li').prev().length>0){
        $('#ns_lightbox_title').animate({'opacity' : 0}, 250);
        $('#ns_lightbox_inner img').animate({'opacity' : 0}, 250, function(){
          var id = $('#'+ns_lightbox_current).parent('li').prev().children('a').attr('id');
          var bigimg = $('#'+id).attr('href');
          var title = $('#'+id).attr('title');
          //$('#ns_lightbox_inner img').attr('src',bigimg);
          $('#ns_lightbox_title').html(title);
          ns_lightbox_current = id;
          $('#ns_lightbox_inner img').attr('src',bigimg).ready(function(){
            $(this).animate({'opacity' : 1}, 250);
            $('#ns_lightbox_title').animate({'opacity' : 1}, 250);
          });
        });
    }
  });
  
  $('#ns_lightbox_next').click(function(){
    if($('#'+ns_lightbox_current).parent('li').next().length>0){
        $('#ns_lightbox_title').animate({'opacity' : 0}, 250);
        $('#ns_lightbox_inner img').animate({'opacity' : 0}, 250, function(){
          var id = $('#'+ns_lightbox_current).parent('li').next().children('a').attr('id');
          var bigimg = $('#'+id).attr('href');
          var title = $('#'+id).attr('title');
          //$('#ns_lightbox_inner img').attr('src',bigimg);
          $('#ns_lightbox_title').html(title);
          ns_lightbox_current = id;
          $('#ns_lightbox_inner img').attr('src',bigimg).ready(function(){
            $(this).animate({'opacity' : 1}, 250);
            $('#ns_lightbox_title').animate({'opacity' : 1}, 250);
          });
        });
    }
  });
  
  $('#ns_lightbox_close').click(function(){
    hideNsLightbox();
  });
  
  $('#ns_lightbox_overlay').click(function(){
    hideNsLightbox();
  });
  
  //---------------------------------------------------flickrGallery END------------------------------------------------//
  
  $('.surveyclick').click(function(){
    createCookie('survey','clicked',false);
    $('#survey_shadow').css('display','none');
  });
  
  $('.nav_drpdwn').mouseenter(function(){
    $('#nav li a').css('color','#303030');
  }).mouseleave(function(){
    $('#nav li a').css('color','#fff');
  });
  
  if($('#eventsslider').length > 0){
    $('#eventsslider .imagetitle').html($('#eventsslider').children('ul:first').children('li:last').html());
    $('#eventsslider .totalslides').html($('#eventsslider').children('ul').length);
  }
  if($('#nightsslider').length > 0){
    var title = $('#nightsslider').children('ul:first').children('li:last').html();
    var stringy = title.replace('<br>','');
    $('#nightsslider .imagetitle').html(stringy);
    $('#nightsslider .totalslides').html($('#nightsslider').children('ul').length);
  }
  $('.btn_reno').click(function(){
    $('.btn_tahoe').removeClass('active');
    $('.btn_reno').addClass('active');
    $('#w_reno').show();
    $('#w_tahoe').hide();
    return false
  });
  $('.btn_tahoe').click(function(){
    $('.btn_reno').removeClass('active');
    $('.btn_tahoe').addClass('active');
    $('#w_tahoe').show();
    $('#w_reno').hide();
    return false
  });
  $("body").hover(function(){
    $('.nav_drpdwn').hide()
  });
  hn("#btn_one","#drp_one");
  hn("#btn_two","#drp_two");
  hn("#btn_three","#drp_three");
  hn("#btn_four","#drp_four");
  hn("#btn_five","#drp_five");
  hn("#btn_six","#drp_six");
  hn("#btn_seven","#drp_seven");
  hn("#btn_eight","#drp_eight");
  hn("#btn_nine","#drp_nine");
  accd();//$('.tabNavigation li:eq(3)').css('margin','0px');$('.sthldr_gallery_thumb img:nth-child(3)').css('margin','0px');
  $(".sthldr_gallery_thumb img").click(function(){
    var largePath=$(this).attr("src");
    var title = $(this).attr('title');
    $(".sthldr_gallery_main .sthldr_gallery_image img").attr({src:largePath});
    $('.sthldr_gallery_image_name').html(title);
    return false;
  });
  $('.sthldr_gallery_thumb .prev').click(function(){
    var min = 0;
    if(parseInt($('.sthldr_gallery_slider').css('left')) < 0){
      var newleft = parseInt($('.sthldr_gallery_slider').css('left')) + 88;
      $('.sthldr_gallery_slider').css('left', newleft);
    }
    return false;
  });
  $('.sthldr_gallery_thumb .next').click(function(){
    var max = ($('.sthldr_gallery_slider').children('img').length - 6) * 88;
    if(parseInt($('.sthldr_gallery_slider').css('left')) > -max){
      var newleft = parseInt($('.sthldr_gallery_slider').css('left')) - 88;
      $('.sthldr_gallery_slider').css('left', newleft);
    }
    return false;
    //alert($('.sthldr_gallery_slider').css('left') + '  ' + max);
  });
  setTimeout("moveThing()", 4000);
  $('.sthldr_gallery_wrap').click(function(){
    moveThing();
  });
  $(".ms").find("tr:even").addClass("stripe");
  $('.btn_advsearch a').click(function(){
    $('#adv_search').stop().slideToggle('fast');
    $(this).toggleClass('show');
    $(this).html("Advanced Search");
    $('.show').html("Hide Search");
    return false
  });
  $('#btn_advsearch_hide a').click(function(){
    $('#adv_search').stop().slideUp('fast');
    $('.btn_advsearch a').toggleClass('show').html("Advanced Search");
    return false
  });
  $('#eventsslider .arrowleft').click(function(){
    $('#eventsslider .imagetitle').fadeOut('fast', function(){
      if($('#eventsslider').children('ul:first').css('display') !="block"){
        $('#eventsslider').children('ul:visible').fadeOut('slow').prev().fadeIn('slow',function(){$('#eventsslider .imagetitle').html($('#eventsslider').children('ul:visible').children('li:last').html()).fadeIn('slow');});
        var newval = parseInt($('#eventsslider .currentslide').html()) - 1;
        $('#eventsslider .currentslide').html(newval);
      }
      else{
        $('#eventsslider').children('ul:visible').fadeOut('slow');
        $('#eventsslider').children('ul:last').fadeIn('slow',function(){$('#eventsslider .imagetitle').html($('#eventsslider').children('ul:visible').children('li:last').html()).fadeIn('slow');});
        $('#eventsslider .currentslide').html($('#eventsslider').children('ul').length);
      }
    });
  });
  $('#eventsslider .arrowright').click(function(){
    $('#eventsslider .imagetitle').fadeOut('fast', function(){
      if($('#eventsslider').children('ul:last').css("display") != "block"){
        $('#eventsslider').children('ul:visible').fadeOut('slow').next().fadeIn('slow',function(){$('#eventsslider .imagetitle').html($('#eventsslider').children('ul:visible').children('li:last').html()).fadeIn('slow');});
        var newval = parseInt($('#eventsslider .currentslide').html()) + 1;
        $('#eventsslider .currentslide').html(newval);
      }
      else{
        $('#eventsslider').children('ul:visible').fadeOut('slow');
        $('#eventsslider').children('ul:first').fadeIn('slow',function(){$('#eventsslider .imagetitle').html($('#eventsslider').children('ul:visible').children('li:last').html()).fadeIn('slow');});
        $('#eventsslider .currentslide').html('1');
      }
    });
  });
  
  $('#nightsslider .arrowleft').click(function(){
    $('#nightsslider .imagetitle').fadeOut('fast', function(){
      if($('#nightsslider').children('ul:first').css('display') !="block"){
        var title = $('#nightsslider').children('ul:visible').prev().children('li:last').html();
        var stringy = title.replace('<br>','');
        $('#nightsslider').children('ul:visible').fadeOut('slow').prev().fadeIn('slow',function(){$('#nightsslider .imagetitle').html(stringy).fadeIn('slow');});
        var newval = parseInt($('#nightsslider .currentslide').html()) - 1;
        $('#nightsslider .currentslide').html(newval);
      }
      else{
        var title = $('#nightsslider').children('ul:last').children('li:last').html();
        var stringy = title.replace('<br>','');
        $('#nightsslider').children('ul:visible').fadeOut('slow');
        $('#nightsslider').children('ul:last').fadeIn('slow',function(){$('#nightsslider .imagetitle').html(stringy).fadeIn('slow');});
        $('#nightsslider .currentslide').html($('#nightsslider').children('ul').length);
      }
    });
  });
  $('#nightsslider .arrowright').click(function(){
    $('#nightsslider .imagetitle').fadeOut('fast', function(){
      if($('#nightsslider').children('ul:last').css("display") != "block"){
        var title = $('#nightsslider').children('ul:visible').next().children('li:last').html();
        var stringy = title.replace('<br>','');
        $('#nightsslider').children('ul:visible').fadeOut('slow').next().fadeIn('slow',function(){$('#nightsslider .imagetitle').html(stringy).fadeIn('slow');});
        var newval = parseInt($('#nightsslider .currentslide').html()) + 1;
        $('#nightsslider .currentslide').html(newval);
      }
      else{
        var title = $('#nightsslider').children('ul:first').children('li:last').html();
        var stringy = title.replace('<br>','');
        $('#nightsslider').children('ul:visible').fadeOut('slow');
        $('#nightsslider').children('ul:first').fadeIn('slow',function(){$('#nightsslider .imagetitle').html(stringy).fadeIn('slow');});
        $('#nightsslider .currentslide').html('1');
      }
    });
  });
  
  $('#survey_close').click(function(){
    $('#survey_shadow').css('display','none');
  });
  
$('.sthldr_gallery .sthldr_gallery_main .sthldr_gallery_wrap .fullscreen').click(function() { 
 $('#fullscreen_gallery_image').append('<img width="880" height="604" alt="'+$('.sthldr_gallery .sthldr_gallery_main .sthldr_gallery_image img').attr('alt')+'" src="'+$('.sthldr_gallery .sthldr_gallery_main .sthldr_gallery_image img').attr('src')+'" />'); 
 $('#fullscreen_pagination').append($('.sthldr_gallery .sthldr_gallery_main .sthldr_gallery_wrap .sthldr_gallery_thumb .sthldr_gallery_slider').html()); 
 $('#fullscreen_pagination_wrapper .fullscreen_gallery_image_name').html($('.sthldr_gallery .sthldr_gallery_main .sthldr_gallery_wrap .sthldr_gallery_image_name').html()); 
 $('#fullscreen_pagination img').click(function() { 
  $('#fullscreen_pagination_wrapper .fullscreen_gallery_image_name').html($(this).attr('title')); 
  $('#fullscreen_gallery_image img').attr('src',$(this).attr('src')); 
  $('#fullscreen_gallery_image img').attr('alt',$(this).attr('alt'));
  return false;
 }); 
 $('#fullscreen_background').css('display','block'); 
 $('#fullscreen_container').css('display','block'); 
 setTimeout(function(){  
  $('#fullscreen_pagination_wrapper').animate({ bottom: '-64px' }, 500, function(){  
   $('#fullscreen_pagination_wrapper').css('background','transparent url("http://www.visitrenotahoe.com/assets_11/images/bg_stkhldr_thumbs2.png") no-repeat scroll center top'); 
  });  
 }, 4000); 
 $('#fullscreen_pagination_wrapper').click(function(){ moveFullscreenPagination(); }); 
 $('#fullscreen_container #icon_close, #fullscreen_background').click(function() { 
  $('#fullscreen_gallery_image').empty(); 
  $('#fullscreen_pagination').empty(); 
  $('#fullscreen_pagination_wrapper .fullscreen_gallery_image_name').empty(); 
  $('#fullscreen_background').css('display','none'); 
  $('#fullscreen_container').css('display','none'); 
 }); 
});
  
});	

 function moveFullscreenPagination(){ 
 if(parseInt($('#fullscreen_pagination_wrapper').css('bottom')) == 0){ 
  $('#fullscreen_pagination_wrapper').css('background','transparent url("http://www.visitrenotahoe.com/assets_11/images/bg_stkhldr_thumbs2.png") no-repeat scroll center top'); 
  $('#fullscreen_pagination_wrapper').animate({ bottom: '-64px' }, 500); 
 } else { 
  $('#fullscreen_pagination_wrapper').css('background','transparent url("http://www.visitrenotahoe.com/assets_11/images/bg_stkhldr_thumbs.png") no-repeat scroll center top'); 
  $('#fullscreen_pagination_wrapper').animate({ bottom: '0' }, 500); 
 } 
}
 

$(function() {
       var zIndexNumber = 5000;
       // Put your target element(s) in the selector below!
       $("p#logo").each(function() {
               $(this).css('zIndex', zIndexNumber);
               zIndexNumber -= 200;
       });
});

function createCookie(name,value,days) {
  if (days) {
    var date = new Date();
    date.setTime(date.getTime()+(days*24*60*60*1000));
    var expires = "; expires="+date.toGMTString();
  }
  else var expires = "";
  document.cookie = name+"="+value+expires+"; path=/";
}


function createNsLightbox(){
  var lightboxoverlayhtml = '<div id="ns_lightbox_overlay"></div>';
  $('body').append(lightboxoverlayhtml);
  $('#ns_lightbox_overlay').css({'height' : $('body').css('height'),
                                'width' : '100%',
                                'background-color' : '#000',
                                'opacity' : 0,
                                'z-index' : '200',
                                'display' : 'none',
                                'position' : 'absolute',
                                'top' : 0,
                                'left' : 0});
  var lightboxhtml = '<div id="ns_lightbox"><div id="ns_lightbox_inner"><img src="" style="width:720px; height:479px;" /><div id="ns_lightbox_prev"></div><div id="ns_lightbox_next"></div><div id="ns_lightbox_title"></div><div id="ns_lightbox_close"></div></div></div>';
  $('body').append(lightboxhtml);
  $('#ns_lightbox').css({'height' : '519px',
                         'width' : '720px',
                         'padding' : '10px',
                         'background-color' : '#fff',
                         'opacity' : 0,
                         'z-index' : '210',
                         'display' : 'none',
                         'position' : 'absolute',
                         'top' : 75,
                         'left' : (parseInt($('body').css('width')) /2) - 370});
  $('#ns_lightbox_inner').css({'height' : '479px',
                             'width' : '720px',
                             'position' : 'relative',
                             'background-image' : 'url(http://www.visitrenotahoe.com/assets_11/images/lightbox-ico-loading.gif)',
                             'background-position' : 'center center',
                             'background-repeat' : 'no-repeat'});
  $('#ns_lightbox_inner img').css({'width' : '720px','height' : '479px','opacity' : 0});
  $('#ns_lightbox_prev').css({'width': '360px', 'height': '479px', 'position' : 'absolute', 'top' : '0', 'left' : '0', 'background-image' : 'url(http://www.visitrenotahoe.com/assets_11/images/lightbox-btn-prev.gif)', 'background-position' : 'center left', 'background-repeat' : 'no-repeat', 'cursor' : 'pointer', 'opacity' : '0.8'});
  $('#ns_lightbox_next').css({'width': '360px', 'height': '479px', 'position' : 'absolute', 'top' : '0', 'right' : '0', 'background-image' : 'url(http://www.visitrenotahoe.com/assets_11/images/lightbox-btn-next.gif)', 'background-position' : 'center right', 'background-repeat' : 'no-repeat', 'cursor' : 'pointer', 'opacity' : '0.8'});
  $('#ns_lightbox_title').css({'height' : '20px','padding' : '10px','font-weight' : 'bold','color' : '#000','opacity' : 0});
  $('#ns_lightbox_close').css({'height' : '29px',
                             'width' : '29px',
                             'position' : 'absolute',
                             'top' : '-22px',
                             'right' : '-22px',
                             'cursor' : 'pointer',
                             'background-image' : 'url(/assets_11/images/survey_close.png)',
                             'background-position' : 'top left',
                             'background-repeat' : 'no-repeat'});
}

function showNsLightbox(){
  $('#ns_lightbox_overlay').css({'height' : $('body').css('height')});
  $('#ns_lightbox_overlay').css({'display' : 'block'}).animate({'opacity' : 0.8}, 250);
  $('#ns_lightbox').css({'display' : 'block', 'top': ($(window).scrollTop() + 75)}).animate({'opacity' : 1}, 250);
    $('#ns_lightbox_inner img').load(function(){
    $(this).animate({'opacity' : 1}, 250);
    $('#ns_lightbox_title').animate({'opacity' : 1}, 250);
    });
}

function hideNsLightbox(){
  $('#ns_lightbox').animate({'opacity' : 0}, 200, function(){
    $('#ns_lightbox').css('display','none');
  });
  $('#ns_lightbox_inner img').animate({'opacity' : 0},200);
  $('#ns_lightbox_title').animate({'opacity' : 0},200);
  $('#ns_lightbox_overlay').animate({'opacity' : 0}, 200, function(){
    $('#ns_lightbox_overlay').css('display','none');
  });
}

/*-------------------------------------------------------------------- 
 * JQuery Plugin: "EqualHeights"
 * by:  Scott Jehl, Todd Parker, Maggie Costello Wachs (http://www.filamentgroup.com)
 *
 * Copyright (c) 2008 Filament Group
 * Licensed under GPL (http://www.opensource.org/licenses/gpl-license.php)
 *
 * Description: Compares the heights or widths of the top-level children of a provided element 
     and sets their min-height to the tallest height (or width to widest width). Sets in em units 
     by default if pxToEm() method is available.
 * Dependencies: jQuery library, pxToEm method  (article: 
    http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/)                
 * Usage Example: $(element).equalHeights();
      Optional: to set min-height in px, pass a true argument: $(element).equalHeights(true);
 * Version: 2.0, 08.01.2008
--------------------------------------------------------------------*/

$.fn.equalHeights = function(px) {
  $(this).each(function(){
    var currentTallest = 0;
    $(this).children().each(function(i){
      if ($(this).height() > currentTallest) { currentTallest = $(this).height(); }
    });
    if (!px || !Number.prototype.pxToEm) currentTallest = currentTallest.pxToEm(); //use ems unless px is specified
    // for ie6, set height since min-height isn't supported
    if ($.browser.msie && $.browser.version == 6.0) { $(this).children().css({'height': currentTallest}); }
    $(this).children().css({'min-height': currentTallest}); 
  });
  return this;
};

/*-------------------------------------------------------------------- 
 * jQuery plugins: toEm() and toPx()
 * by Scott Jehl (scott@filamentgroup.com), http://www.filamentgroup.com
 * Copyright (c) Filament Group
 * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
 * Article: http://www.filamentgroup.com/lab/update_jquery_plugin_for_retaining_scalable_interfaces_with_pixel_to_em_con/
 * Options:                     
     scope: string or jQuery selector for font-size scoping      
 * Usage Example: $(myPixelValue).toEm(); or $(myEmValue).toPx();
--------------------------------------------------------------------*/

$.fn.toEm = function(settings){
  settings = jQuery.extend({
    scope: 'body'
  }, settings);
  var that = parseInt(this[0],10);
  var scopeTest = jQuery('<div style="display: none; font-size: 1em; margin: 0; padding:0; height: auto; line-height: 1; border:0;">&nbsp;</div>').appendTo(settings.scope);
  var scopeVal = scopeTest.height();
  scopeTest.remove();
  return (that / scopeVal).toFixed(8) + 'em';
};


$.fn.toPx = function(settings){
  settings = jQuery.extend({
    scope: 'body'
  }, settings);
  var that = parseFloat(this[0]);
  var scopeTest = jQuery('<div style="display: none; font-size: 1em; margin: 0; padding:0; height: auto; line-height: 1; border:0;">&nbsp;</div>').appendTo(settings.scope);
  var scopeVal = scopeTest.height();
  scopeTest.remove();
  return Math.round(that * scopeVal) + 'px';
};

/*-------------------------------------------------------------------- 
 * javascript method: "pxToEm"
 * by:
   Scott Jehl (scott@filamentgroup.com) 
   Maggie Wachs (maggie@filamentgroup.com)
   http://www.filamentgroup.com
 *
 * Copyright (c) 2008 Filament Group
 * Dual licensed under the MIT (filamentgroup.com/examples/mit-license.txt) and GPL (filamentgroup.com/examples/gpl-license.txt) licenses.
 *
 * Description: Extends the native Number and String objects with pxToEm method. pxToEm converts a pixel value to ems depending on inherited font size.  
 * Article: http://www.filamentgroup.com/lab/retaining_scalable_interfaces_with_pixel_to_em_conversion/
 * Demo: http://www.filamentgroup.com/examples/pxToEm/     
 *              
 * Options:                     
     scope: string or jQuery selector for font-size scoping
     reverse: Boolean, true reverses the conversion to em-px
 * Dependencies: jQuery library              
 * Usage Example: myPixelValue.pxToEm(); or myPixelValue.pxToEm({'scope':'#navigation', reverse: true});
 *
 * Version: 2.0, 08.01.2008 
 * Changelog:
 *    08.02.2007 initial Version 1.0
 *    08.01.2008 - fixed font-size calculation for IE
--------------------------------------------------------------------*/

Number.prototype.pxToEm = String.prototype.pxToEm = function(settings){
  //set defaults
  settings = jQuery.extend({
    scope: 'body',
    reverse: false
  }, settings);
  
  var pxVal = (this == '') ? 0 : parseFloat(this);
  var scopeVal;
  var getWindowWidth = function(){
    var de = document.documentElement;
    return self.innerWidth || (de && de.clientWidth) || document.body.clientWidth;
  };  
  
  /* When a percentage-based font-size is set on the body, IE returns that percent of the window width as the font-size. 
    For example, if the body font-size is 62.5% and the window width is 1000px, IE will return 625px as the font-size.   
    When this happens, we calculate the correct body font-size (%) and multiply it by 16 (the standard browser font size) 
    to get an accurate em value. */
        
  if (settings.scope == 'body' && $.browser.msie && (parseFloat($('body').css('font-size')) / getWindowWidth()).toFixed(1) > 0.0) {
    var calcFontSize = function(){    
      return (parseFloat($('body').css('font-size'))/getWindowWidth()).toFixed(3) * 16;
    };
    scopeVal = calcFontSize();
  }
  else { scopeVal = parseFloat(jQuery(settings.scope).css("font-size")); };
      
  var result = (settings.reverse == true) ? (pxVal * scopeVal).toFixed(2) + 'px' : (pxVal / scopeVal).toFixed(2) + 'em';
  return result;
};
