// this is the for css dropdown menu
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(){

	$('div#gallery a').lightBox();

	// datepicker fields
	//$("input.datepicker_single").datepicker({dateFormat: 'dd/mm/yy'}); 

	// dates / prices calendar clickable tabs
	$('div#sidebar-dates-prices-table div.tabs a.tab').bind('click', function(){
		$('div#sidebar-dates-prices-table div.tabs a.tab').removeClass('tab-active');
		$(this).addClass('tab-active');
		$('div#sidebar-dates-prices-table table').hide();
		$('div#sidebar-dates-prices-table table#dates-prices-tab-' + $(this).attr('rel')).show();
		return false;
	});
	
	// dates / prices calendar clickable tabs main page
	$('div#dates-prices-container div.tabs a.tab').bind('click', function(){
		$('div#dates-prices-container div.tabs a.tab').removeClass('tab-active');
		$(this).addClass('tab-active');
		$('div#dates-prices-container div.table').hide();
		$('div#dates-prices-container div#dates-prices-table-' + $(this).attr('rel')).fadeIn();
		return false;
	});
	
	$('div#nav ul li a.noclick').bind('click', function(){
		return false;
	});

	$('input#EnquiryContactTypeRequestABrochureByPost').bind('change', function(){
		if ($(this).attr('checked')) {
			$('div#fields-address').slideDown();			
		} else {
			$('div#fields-address').slideUp();			
		}
	});

	// stripe the ticks green and black
	//$('div.ticks ul li:even').addClass('black');
	//$('ul.ticks li:even').addClass('black');

	// $('div#weather-feed-devon').load('/weather.com/weather.php?location_code=UKXX0960');
	// $('div#weather-feed-herefordshire').load('/weather.com/weather.php?location_code=UKXX0245');
	// $('div#weather-feed-spain').load('/weather.com/weather.php?location_code=SPXX0052');
	// $('div#weather-feed-cotswolds').load('/weather.com/weather.php?location_code=UKXX1359');
	// $('div#weather-feed-bristol').load('/weather.com/weather.php?location_code=UKXX0025');
	// $('div#weather-feed-london').load('/weather.com/weather.php?location_code=UKXX0085');

});

