
<!--//--><![CDATA[//><!--
sfHover = function() {
	var sfEls = document.getElementById("nav").getElementsByTagName("LI");
	for (var i=0; i<sfEls.length; i++) {
		sfEls[i].onmouseover=function() {
			this.className+=" sfhover";
		}
		sfEls[i].onmouseout=function() {
			this.className=this.className.replace(new RegExp(" sfhover\\b"), "");
		}
	}
}
if (window.attachEvent) window.attachEvent("onload", sfHover);
//--><!]]>

$(document).ready(function() {
  $('#specialsDisplay img').each(function(){
	//Change the src of each img
	$(this).attr('src', '/images/img-book-now.png');
	$(this).css('display', 'block');
  });
});

$(function() {
	$('#slideshow').cycle({
		fx:     'fade',
		speed:  '2000',
		timeout: '6000'
	});
});

/*Contact Form*/
$(function() {

  $("#general-contact-form").submit(function() {
	
	//var dataString = 'name='+ firstName + '&lastName=' + lastName + '&email=' + email + '&phone=' + phone + '&comments=' + comments;
	var params = $.param($("input,textarea"));
	//alert (dataString);return false;
		
	$.ajax({
      cache: false,
      type: "POST",
      url: "/process.cfm",
      data: params,
	  beforeSend: function(){
	     return $("#general-contact-form").validate().form();
	  },	  
      success: function() {
		$('#main-content h1').hide();
		$('#contact-details').hide();
        $('#contact-form').html("<div id='message'></div>");
        $('#message').html("<img src='images/check.png' id='checkmark' />")
        .append("<h2>Contact Form Submitted!</h2>")
		.append("<p>We will be in touch soon.</p>")
        .hide()
        .fadeIn(1500);
      }
     });
    return false;
	});
}); 



//this is used to bind a click event to specials on right side of homepage; specials are pulled in from a script from guestdeskt.com, see _footer.cfm
//doing this for cross domain analytics tracking
$(function() {

  $('#specialsDisplay a:link').bind('click',function(){
          
          var tracker = _gaq._getAsyncTracker();
          window.open(tracker._getLinkerUrl(this.href));
          
          return false;
        
        });

});

//cross domain analytics tracking for all hrefs
function openWindow(link) {
     
    _gaq.push(function() {
      var tracker = _gaq._getAsyncTracker();  //add name param if needed
      window.open(tracker._getLinkerUrl(link.href));
    });
    return false;
      
}
