<!--
jQuery.preloadImages = function() {
	var preloads = arguments[0];
	var pathPrefix = arguments[1];
	for ( var imgCnt = preloads.length - 1; imgCnt > 0; imgCnt-- )  {
		jQuery('<img>').attr('src', pathPrefix + preloads[imgCnt]);
	}
}
// Preload required images
var preloads = ['buttons/products-off.png', 'buttons/products-on.png', 'buttons/where-to-buy-off.png', 'buttons/where-to-buy-on.png', 'buttons/become-a-dealer-off.png', 'buttons/become-a-dealer-on.png', 'buttons/service-and-warranty-off.png', 'buttons/service-and-warranty-on.png', 'buttons/contact-us-off.png', 'buttons/contact-us-on.png', 'buy-now-button-off.png', 'buy-now-button-on.png'];
$.preloadImages(preloads, '/images/');

$(document).ready(function(){
	// Testimonial slideshow
	$('#testimonialSlideshow').cycle({
			timeout: 14000,
			speed: 1500
	});
	// Initialise twitter feed
	$('#twitterFeed').tweet({
		username: 'iPillow',
		join_text: 'auto',
		avatar_size: 0,
		count: 3,
		auto_join_text_default: '',
		auto_join_text_ed: '',
		auto_join_text_ing: '',
		auto_join_text_reply: '',
		auto_join_text_url: '',
		loading_text: 'loading tweets...'
	});
	// Handle image button mouse overs
	$('img.imageButton').mouseover( function(e){
		var imgSrc = $(this).attr('src');
		imgSrc = imgSrc.replace('-off', '-on');
		$(this).attr('src', imgSrc);
	});
	$('img.imageButton').mouseout( function(e){
		var imgSrc = $(this).attr('src');
		imgSrc = imgSrc.replace('-on', '-off');
		$(this).attr('src', imgSrc);
	});
});

-->

