$(function(){
	
	$('.villa-book').click(function(){
		var id = $(this).attr('id');
		var book = $(this).attr('checked');
		
		$.ajax({
			url: '../../admin/book',
			data: 'id=' + id + '&' + 'book=' + book,
			type: 'post',
			success: function(){
				
			}
		});
	});
	
	$('#map-canvas').gMap({
		zoom: 10,
		markers: [{
				// Casa Roma
				latitude: 45.355282, 
				longitude: 13.889637,
				html: $('#map-casa-roma').html()
			},{
				// Casa Bella
				latitude: 45.345389, 
				longitude: 13.746815,
				html: $('#map-casa-bella').html()
			},{
				// Casa Sienna
				latitude: 45.379884,
				longitude: 13.922338,
				html: $('#map-casa-sienna').html()
			}]
	});
	
	$('#image-rotator').cycle({
		fx: 'fade'
	});
	
	
	$('.price-field').change(function(){
		var id = $(this).attr('rel');
		var price = $(this).val();
		
		$.ajax({
			url: '../../admin/price',
			data: 'id=' + id + '&' + 'price=' + price,
			type: 'post',
			success: function(){
				
			}
		});
	});
	
	$('a.villa-gallery').fancybox({
		'overlayColor': '#333',
		'cyclic': true
	});
});
