$(document).ready(function() {
  	var el = $('#county_hotel_select');
	el.html(el.html().replace(/Bewleys Hotel/ig, ""));          
	el.html(el.html().replace(/3\*/ig, ""));

	//var numnights = $('.nninput');
	$('.nninput').val(1);
	$('.promo_code_label').html("Promo:");
	$('label.departure').html("Depart:");

$("#county_hotel_select option[value='c_40']").remove();
$("#county_hotel_select option[value='c_951']").remove();
$("#county_hotel_select option[value='c_11']").remove();

});        




function slideSwitch() {
    var $numberimages = $('#slideshow .panel');
    if ( $numberimages.length != 1 )
	{
	    var $active = $('#slideshow .active');

	    if ( $active.length == 0 ) $active = $('#slideshow .panel:last');

	    var $next =  $active.next().length ? $active.next()
	        : $('#slideshow .panel:first');

	    $active.addClass('last-active');

	    $next.css({opacity: 0.0})
	        .addClass('active')
	        .animate({opacity: 1.0}, 1000, function() {
	            $active.removeClass('active last-active');
	        }); 
	}
}


$(function() {
    setInterval( "slideSwitch()", 4000 );
});

$(document).ready(function(){$("a[href^='http']").not("[href*='bewleyshotels.com']").attr('target','_blank');});
$(document).ready(function(){$("a[href$=pdf]").attr('target','_blank');});
$(function(){
    $('a.pageedit').click(function(){
        window.open(this.href);
        return false;
    });
});





function is_int(value){
  if((parseFloat(value) == parseInt(value)) && !isNaN(value)){
      return true;
  } else {
      return false;
  }
}


$(document).ready(function(){
    $('#DatesForm').submit(function() {
	if(!is_int($('.nninput').val())){
		alert("Number of Nights must be a number. You can change it once you reach the booking engine if necessary.");
		return false;
	}
    });
});     






