$(document).ready(function() {
	
	var iever = ($.browser.msie && parseInt($.browser.version, 10)) || 1000;
	
	homepageBillboard();
	
	setInterval('setImageHeight()', 1000);
	
});

function homepageBillboard() {
	
	var scrollspeed = 800; // Duration of scrolling animation */
	var autoshowtime = 6000; /* The time between auto scrolls */
	
	/* $(".product-cycler").scrollable({
		circular: true,
		keyboard: 'static',
		speed: scrollspeed
	}).autoscroll(autoshowtime).navigator({navi: ".pagination", indexed: true}); */
	
	$(".scroll").scrollable({
		circular: true,
		keyboard: false,
		speed: scrollspeed,
		prev: '.prev-arrow',
		next: '.next-arrow'
	}).autoscroll(autoshowtime).navigator({navi: '.pagination'});
	
	// Vertical centre product and service images
	// $('#homepage-content .products-row .product-cycler .product-slider .product-set .product .product-image .banner,
	// 	#homepage-content .services-row .site-service .product-image .banner').each(function() {
	
}

function setImageHeight() {
	$('.product-image .banner').each(function() {
		var jthis = $(this);
		
		var parentheight = jthis.parent().height();
		// alert(jthis.height());
		var margin = parentheight / 2 - jthis.height() / 2;
		
		jthis.animate({marginTop: margin}, 0);
	});
}
