// hide On Startup
$('<link />',{
    rel:'stylesheet',
    type:'text/css',
    href:'http://www.izumi.cc/_css/hideOnLoad.css'
}).appendTo('head');

// ready
$(function(){
	var activeImageBase = '_images/home_features/active/home_features_%%.jpg';
	var inactiveImageBase = '_images/home_features/inactive/home_features_%%.jpg';
	$('.featuresItem').hover(function(){
		$(this).fadeTo(0,0);

		var origID = $(this).attr('id');
		var seqNum = origID.replace('features','');
		var txtID = '#'+ origID + 'text';
		$(this).css('background', 'url('+activeImageBase.replace('%%', make2digit(seqNum)) +') no-repeat');
		
		$(this).fadeTo(300,1.0);
		$(txtID).show();
	},function(){
		var origID = $(this).attr('id');
		var seqNum = origID.replace('features','');
		var txtID = '#'+ origID + 'text';
		$(txtID).fadeOut(200);
		$(this).fadeTo(0,0);
		$(this).css('background', 'url('+inactiveImageBase.replace('%%', make2digit(seqNum)) +') no-repeat');
		$(this).fadeTo(700,1);
	});
	function make2digit(n){
		if(n < 10){
			n = '0'+n;
		}
		return n;
	}
	
	// tweet
	$.Juitter.start({
		searchType:'searchWord',
		searchObject:'from%3Aizumicc+OR+from%3Atakamitsu_y+OR+from%3Atomo_ymzk',
		placeHolder:'tweet',
		loadMSG:'image/gif',
		imgName:'_images/blackloader.gif',
		total:3,
		readMore:'>>',
		openExternalLinks:'newWindow'
	});
});
