// javascript jquery functions

$(document).ready(function() {

	// homepage feature list (image rotator)
	$.featureList(
		$("#ul-feature-list li a"),
		$("#ul-output-feature-list li"), {
			start_item	:	1
		}
	);
	
	// ----------------------------------------------------------------------------------------------------
	
	// homepage tabs (search and contact us)
	$(function () {
		var tabContainers = $('div.tabs-property-search-contact-us > div');
		tabContainers.hide().filter(':first').show();
		
		$('div.tabs-property-search-contact-us ul.tabs-property-search-contact-us a.tabs-contact-us').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.tabs-property-search-contact-us ul.tabs-property-search-contact-us a').removeClass('tabs-contact-us-selected');
			$(this).addClass('tabs-contact-us-selected');
			return false;
		}).filter(':first').click();		
		
		
		$('div.tabs-property-search-contact-us ul.tabs-property-search-contact-us a.tabs-property-search').click(function () {
			tabContainers.hide();
			tabContainers.filter(this.hash).show();
			$('div.tabs-property-search-contact-us ul.tabs-property-search-contact-us a').removeClass('selected');
			$(this).addClass('selected');
			return false;
		}).filter(':first').click();		
	});
	
	// ----------------------------------------------------------------------------------------------------	
	
	// homepage customer quote rotator
	$('ul#quotes').quote_rotator();
	// ----------------------------------------------------------------------------------------------------		
	
});


// google maps api (contact us)
function initialize() {
	var latlng = new google.maps.LatLng(51.554407,-1.777167);
	var myOptions = {
		zoom: 16,
		center: latlng,
		mapTypeId: google.maps.MapTypeId.ROADMAP
	};
	
	var map = new google.maps.Map(document.getElementById("map_canvas"),myOptions);
	
	var image = '/img/google-icon.png';
	var myLatLng = new google.maps.LatLng(51.554299,-1.77640);
	var placeMarker = new google.maps.Marker({
		position: myLatLng,
		map: map,
		icon: image
	});	
}	

// ----------------------------------------------------------------------------------------------------	
