$(document).ready(function() {
	
	//intro paragraphs
  // $('#content-main p:first').addClass('p-first');
	
	//append bullets to list nav for properly sized bullet with hover states
	$('#nav-quick li:not(.nav-phone) a').prepend('&bull;&nbsp;');
	
	//zoom in map
	$('#map-zoom .images')
	.after('<div class="nav"></div>') 
	.cycle({ 
	    fx:     'fadeZoom', 
	    speed:  300, 
			pager: '#map-zoom .nav',
			next: '#map-zoom .images',
	    timeout: 0,
			pagerAnchorBuilder: function(idx){
				return '<a href="#"><span class="nav-' + (idx+1) + '">Zoom Out/In</span></a>';
			}
	});
	
	//slideshow cycle for homepage
	var $slideshowImages = $('div.slideshow div.images'),
	    numImages = $slideshowImages.children().length;
	if (numImages > 1) {
  	$slideshowImages
  	.before('<div class="nav"></div>') 
  	.cycle({ 
  	    fx: 'scrollHorz', 
  	    autostop: true,
  	    autostopCount: numImages+1,
  	    speed:  300, 
  	    timeout: 6000, 
        next: '.slideshow .images',
  	    pager:  'div.slideshow div.nav:first',
  			pagerAnchorBuilder: function(){
  				return '<a href="#">&bull;</a>';
  			}
  	});
  	if ($('body').is('.events')) {
  	  $('#content-feature .content-one').css({marginTop: $slideshowImages.prev('.nav').height() || 0});
  	}
  }	
	// events calendar - weekend class
	$('table.mini-cal').find('td:nth-child(6), td:last-child').addClass('weekend');
});

/** =Reservations form validation
************************************** */

$(document).ready(function() {
  if (typeof $.fn.tinyvalidate != 'undefined') {
    $('#reservations-form').tinyvalidate({
      positionElement: ['inline', '#submitrequest'],
      positionType: 'after',
      submitDetails: false,
      wrapper: '<span></span>',
      preNotice: 'some information that we need is missing',
      primaryEvent: 'submit',
      secondaryEvent: null
    });
  }
});
