google.setOnLoadCallback(function() {
	$(document).ready(function(){
		initRotator();
	});
});

function initRotator()
{	
	var optionList = {
	    focusBearing: 0,
	    autoplay: true,
	    autoplayPauseOnHover: true,
	    autoplayDuration: 4000,
	    shape: "waterWheel",
	    minOpacity: 0,
	    minScale: 1,
	    duration: 2700,
	    tilt: 0
	};

	$(".rotatorImageList li").bind({
		"reposition": function() {
			var degrees = $(this).data('roundabout').degrees,
				roundaboutBearing = $(this).parent().data('roundabout').bearing,
				rotateX = Math.round(roundaboutBearing - degrees);
			
			$(this).css({
				"-webkit-transform": "perspective(1000) rotateX(" + rotateX + "deg)",
				"-moz-transform": "perspective(1000) rotateX(" + rotateX + "deg)",
				"transform": "perspective(1000) rotateX(" + rotateX + "deg)"
			});
		}
	})

	$(".rotatorImageList").roundabout(optionList);
}
