Cufon.replace('.homepage-block h2,.page-wrap h1');
Cufon.replace('.sm-navigation',{ hover: { color: '#000000' } });

(function($) {
	var cache = [];
  	// Arguments are image paths relative to the current page.
  	$.preLoadImages = function() {
    	var args_len = arguments.length;
    	for (var i = args_len; i--;) {
      		var cacheImage = document.createElement('img');
      		cacheImage.src = arguments[i];
      		cache.push(cacheImage);
    	}
  	}
})(jQuery)

$(document).ready(function(){

	$("a[rel=fancybox]").fancybox({'titleShow' : true});
	jQuery.preLoadImages("/wp-content/themes/kiwaii/css/graphics/rock_bottles.jpg","/wp-content/themes/kiwaii/css/graphics/tagline.jpg","/wp-content/themes/kiwaii/css/graphics/logo.jpg","/wp-content/themes/kiwaii/css/graphics/flowers.jpg","/wp-content/themes/kiwaii/css/graphics/background.jpg");

	// Elements
	var homepageBlock = $('.homepage-block');
	
	homepageBlock.hover(function(){
		$(this).addClass('hovered');
		$(this).stop().animate({'top':'-5px'},300,'easeOutQuad');
		$(this).find('.paint').stop().animate({'opacity':1},200);
	},function(){
		$(this).removeClass('hovered');
		$(this).stop().animate({'top':'0'},300,'easeOutQuad');
		$(this).find('.paint').stop().animate({'opacity':0},200);
	});
	
	homepageBlock.click(function(){
		var linkURL = $(this).find('a').attr('href');
		window.location = linkURL;
	});
    
});
