$(function(){

	// cufon script
	Cufon.replace('#content_area h1', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#content_area_int h1', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#content_area_calendar h1', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('fc-header-title h2', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#reservation_widget h1', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#family_vacation h1', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#family_vacation h2', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#winter_packages h1', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#winter_packages h2', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#right_panel .email_signup .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#right_panel .follow_us .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#right_panel .gift_cards .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#right_panel .restoration .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#right_panel .travel_alerts .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#left_panel .email_signup .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#left_panel .follow_us .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#left_panel .gift_cards .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#left_panel .restoration .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#left_panel .travel_alerts .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('.search .text', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	Cufon.replace('#promo .sidebar_slides p', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	
	
	
	
	//Cufon.replace('#left_panel #sub_links .hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	//Cufon.replace('#left_panel #sub_links .sub_hd', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	//Cufon.replace('#left_panel #sub_links li', { fontFamily: 'Gill Sans Light', fontWeight: '400'});
	

$("#search_events_keyword").click(function(){
	if (this.value == this.defaultValue) this.value = '';
});
$("#search_events_keyword").blur(function(){
	if ( $(this).val().length==0) {
		$(this).val(this.defaultValue);
	}
});
//reservation widget

  $('form[name=omni_reservation_form] .reserv_search_btn').click(function(){
	  $("form[name=omni_reservation_form]").submit();
  });
  
  if ($('.gallery_1').length != 0){
	$(".gallery_1 a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',slideshow:10000});
  }
    
  if ($('.indate').length != 0){
		//reservation widget
		$( ".indate" ).datepicker({
			showOn: 'both',
			buttonImageOnly: true,
			buttonImage: sitepath+'images/calendar.gif',
			buttonText: 'Calendar',
			dateFormat:'mm/dd/yy',
			minDate: 0,
			maxDate: '+1Y'
		});
		$( ".outdate" ).datepicker({
			showOn: 'both',
			buttonImageOnly: true,
			buttonImage: sitepath+'images/calendar.gif',
			buttonText: 'Calendar',
			dateFormat:'mm/dd/yy',
			minDate: 1,
			maxDate: '+1Y'
		});
		$(".indate").change(function(){
			var ci = $(this).datepicker("getDate");
			ci.setDate(ci.getDate()+1);
			$('.outdate').datepicker("setDate",ci);
		});
  }
	
	// Promo Banner
	if ($('.sidebar_slides_main .slide_main').length != 0){
		$('.sidebar_slides_main .slide_main').cycle({ 
			fx: 'fade',
			speed: 3000,
			timeout: 3000,
			//pause: 1,
			pager: '.slide_pager_main',
			pagerAnchorBuilder:	function(index, slide){return '<li><a href="#">'+index+'</a></li>';}		
		});	
	}
	
	// Promo Banner
	if ($('#promo .sidebar_slides').length != 0){
		$("#promo .sidebar_slides").cycle(
		{
			fx: "scrollHorz",
			speed: 500,
			timeout: 5000,
			pager: "ul.slide_pager",
			pagerAnchorBuilder: function(idx, slide)
			{
				return '<li><a href="#">&nbsp;</a></li>';
			}
		});
	}
	
	if ($(".gallery a[rel^='prettyPhoto']").length != 0){
		$(".gallery a[rel^='prettyPhoto']").prettyPhoto({animationSpeed:'slow',slideshow:10000});
		$(".gallery a[rel^='prettyVideo']").prettyPhoto({animationSpeed:'slow',slideshow:100000});
	}
	if ($(".gallery a[rel^='prettyVideo']").length != 0){
		$(".gallery a[rel^='prettyVideo']").prettyPhoto({animationSpeed:'slow',slideshow:100000}); 
	}
	if ($(".lightbox").length != 0){
		$(".lightbox").prettyPhoto({animationSpeed:'slow',slideshow:100000}); 
	}

	//collapse more
	if ($('#collapse_more').length != 0){
	$("#collapse_more").append("<a href='#' class='btn_read_more_close' title='Read Less'>- Read Less</a>").hide();
		$(".btn_read_more").click(function(){
			if ( $(this).next().is(":hidden") ) {
				$(this).next().slideDown("fast");
				$(this).hide();
			} else {
			$(".btn_read_more").next().hide();
				$(this).next().slideDown("fast");
				$(this).show();
			}
		return false;
		})
		$(".btn_read_more_close").click(function(){
			var btnReadMore = $(this).parent().prev()
				$(this).parent().slideUp("fast", function(){
				$(btnReadMore).fadeIn("fast")
		});
		return false;
		})
		
	}
	if ($('.description').length != 0){
		$(".description").append("<a href='#' class='less' title='Less'>- Less</a>").hide();
		$(".morefn").click(function(){
			if ( $(this).next().is(":hidden") ) {
				$(this).next().slideDown("fast");
				$(this).hide();
			} else {
			$(".morefn").next().hide();
				$(this).next().slideDown("fast");
				$(this).show();
			}
			return false;
		})
		$(".less").click(function(){
			var btnReadMore = $(this).parent().prev()
				$(this).parent().slideUp("fast", function(){
				$(btnReadMore).fadeIn("fast")
			});
			return false;
		})
		
	}
		$(".expandAll").click(function(){
			$(".description").slideDown("fast");
			$(".more").hide();			
		})
		
		$(".collapseAll").click(function(){
			$(".description").slideUp("fast");
			$(".more").show();
		})
		
		
				
		$("#email").click(function(){
			if (this.value == this.defaultValue) this.value = '';
		});
		$("#email").blur(function(){
			if ( $(this).val().length==0) {
			$(this).val(this.defaultValue);
			}
		});
		$('.submit').click(function() {
			if(checkEmail(document.NDc0NTgzNTc6LTE.email.value))
				{$("#frmemail").submit();}
		});
		
		
		//Event Calender+
		
		//weather widget
		if ($('.weather').length != 0){
		  jQuery.simpleWeather({
			zipcode: '12561',
			unit: 'f',
			success: function(weather) {
				//jQuery(".weather").html(' '+weather.temp+'&deg; '+weather.units.temp+' '+'<b>Humidity:</b>'+weather.humidity);
				html = '<p><strong>Today\'s High</strong>: '+weather.high+'&deg; '+weather.units.temp+' - <strong>Today\'s Low</strong>: '+weather.low+'&deg; '+weather.units.temp+'</p>';
                html += '<p><img src="'+weather.thumbnail+'"><span class="weathercurrent"><strong>Current Temp</strong>: '+weather.temp+'&deg; '+weather.units.temp+'</span></p>';
                html += '<p><strong>Wind</strong>: '+weather.wind.direction+' '+weather.wind.speed+' '+weather.units.speed+' <strong>Wind Chill</strong>: '+weather.wind.chill+'</p>';
                html += '<p><strong>Currently</strong>: '+weather.currently+' - <strong>Forecast</strong>: '+weather.forecast+'</p>';
               

                $(".weather").html(html);
			},
			error: function(error) {
				jQuery(".weather").html('<p>'+error+'</p>');
			}
		});
	  }
		
		
});
		

		//Custume style select box

(function($){
		$.fn.extend({
		customStyle : function(options) {
		  if(!$.browser.msie || ($.browser.msie&&$.browser.version>6)){
		  return this.each(function() {	  
				var currentSelected = $(this).find(':selected');
				$(this).after('<span class="customStyleSelectBox"><span class="customStyleSelectBoxInner">'+currentSelected.text()+'</span></span>').css({position:'absolute', opacity:0,fontSize:$(this).next().css('font-size')});
				var selectBoxSpan = $(this).next();
				var selectBoxWidth = parseInt($(this).width()) - parseInt(selectBoxSpan.css('padding-left')) -parseInt(selectBoxSpan.css('padding-right'));			
				var selectBoxSpanInner = selectBoxSpan.find(':first-child');
				selectBoxSpan.css({display:'inline-block'});
				selectBoxSpanInner.css({width:selectBoxWidth, display:'inline-block'});
				var selectBoxHeight = parseInt(selectBoxSpan.height()) + parseInt(selectBoxSpan.css('padding-top')) + parseInt(selectBoxSpan.css('padding-bottom'));
				$(this).height(selectBoxHeight).change(function(){				
				selectBoxSpanInner.text($(this).find(':selected').text()).parent().addClass('changed');			
			});			
		  });
		  }
		}
	 });
	})(jQuery);
	$(function(){
		$('.styled').customStyle();
	});
	
