
/*-----------------------------------------------

  * Filename:      custom.js
  * Description:   Javascript Tips.
  * Version:       2010-11-10 (YYYY-MM-DD)
  * Website:       http://diving-anemone.com/
  * Auther:        http://miyanavi.net/ shimoji
  * Copyright:     アネモネフィッシュクラブ

-------------------------------------------------*/





/*
 * EX: checkbox color design
 * update: (2010-06-10) 
 * auther: Luvsic
 * licence: MIT
 * filename: 
 * 
 */


jQuery(function(){
	$(':checked').closest('label').addClass('chekd');
	$('label').click(function(){
		$('label').removeClass('chekd');
		$(':checked').closest('label').addClass('chekd');
	});
});





/*
 * EX: change the input element on focus and blur
 * update(y-m-d): 2010-10-22
 * auther: Luvsic
 * licence: MIT
 * info: http://luvsic.net/item/118
 * filename: 
 * 
 */


jQuery(function(){
	if ($('#mf-1st').length){

		var targetInput = ':text, :password, textarea, select';

		$(targetInput).addClass('jInput');

		$(targetInput).focus(function(){
			$(this).addClass('jFocus');
		});
		$(targetInput).blur(function(){
			if ($(this).find('.jFocus')) {
				$(this).removeClass('jFocus');
			}
		});

	}
});









/*
 * Ex: allows the user to extend the textarea element/area within the web page whenever they feel.
 * update: 1/21,2009
 * info: http://plugins.jquery.com/project/TextAreaResizer
 * 
 */

jQuery(function(){
	if ($('textarea').length){
		$('textarea:not(.processed)').TextAreaResizer();
	};
});





/*
 * Ex: text effect. ※旧版。IE8でエラーが出るためコメントアウト
 * update: 10/3,2010
 * info: http://www.mdn.co.jp/di/articles/416/
 * 

jQuery(function() {
	if ($('#text-cave').length){
		spectrum();
		function spectrum(){
			var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
			$('#text-cave').animate( { color: hue }, 1000);
			spectrum();
		}
	}
});
 */





/*
 * Ex: text gradation effect.
 * update: 5/5,2011
 * info: http://www.mdn.co.jp/di/articles/416/
 * 
 */


jQuery(function() {
	if ($('#text-cave').length){
		$('#text-cave').randomColor({color:'#000000',target:'text',interval:10,amount:1,direction:'+',rgbType:0});
	}
});

