/*

　ネイルサロンB.one専用javascript

*/


jQuery.noConflict();

// メニューの効果音スイッチ
var sound_sw = 0; // 0:OFF 1:ON

// ページの初期処理
function initialize() {
	// メニューの効果音
	var div = document.createElement("div");
	div.id = "SoundUnit"
	document.body.appendChild(div);
	var uAgent = navigator.userAgent.toUpperCase();
	if (uAgent.indexOf("MAC") != -1 && uAgent.indexOf("CHROME") != -1) {
		sound_sw = 0;
	}

	// メニュー初期化(透明度設定)
	jQuery('#navi li').each(function(){if(!jQuery(this).hasClass('active'))jQuery(this).fadeTo(1500, 0.5);});
	//jQuery('#setcourse li').each(function(){jQuery(this).fadeTo(1500, 0.5);});
	
	// follow me
	show_followme();

}





// 特殊効果
jQuery(function() {
	jQuery('#navi li').mouseover(function(){if(!jQuery(this).hasClass('active'))jQuery(this).fadeTo('fast', 1.0);});
	jQuery('#navi li').mouseout(function(){if(!jQuery(this).hasClass('active'))jQuery(this).fadeTo('fast', 0.5);});


	jQuery('.menu tr').mouseover(function()
	{
		var ele = jQuery(this).get(0);
		ele.style.backgroundColor = '#e5f6fc';
		//var hue = 'rgb(' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ',' + (Math.floor(Math.random() * 256)) + ')';
		//jQuery('#header').animate( { backgroundColor: hue }, 1000);
		//jQuery('#header').fadeTo('fast', 0.3);
	});

	jQuery('.menu tr').mouseout(function()
	{
		var ele = jQuery(this).get(0);
		ele.style.backgroundColor = '#ffffff';
		//jQuery(this).animate( { backgroundColor: '#ffffff'}, 1000);
	});

	//jQuery('#blogbanner').mouseover(function(){jQuery(this).fadeTo('fast', 0.8);});
	//jQuery('#blogbanner').mouseout(function(){jQuery(this).fadeTo('fast', 1.0);});

	jQuery('#businesstime').mouseover(function(){jQuery(this).fadeTo('fast', 0.8);});
	jQuery('#businesstime').mouseout(function(){jQuery(this).fadeTo('fast', 1.0);});

	jQuery('#home_menu img').mouseover(function(){jQuery(this).fadeTo('fast', 0.75);});
	jQuery('#home_menu img').mouseout(function(){jQuery(this).fadeTo('fast', 1.0);});

	jQuery('.art img').mouseover(function(){jQuery(this).fadeTo('fast', 0.8);});
	jQuery('.art img').mouseout(function(){jQuery(this).fadeTo('fast', 1.0);});

	//jQuery('#setcourse li').mouseover(function(){jQuery(this).fadeTo('fast', 1.0);});
	//jQuery('#setcourse li').mouseout(function(){jQuery(this).fadeTo('fast', 0.5);});

	// メニュー効果音再生
	jQuery('#navi li').mouseover(function(){if(sound_sw)play();});

});





// twitter表示
function show_twitter() {

	new TWTR.Widget({
		version: 2,
		type: 'search',
		search: 'ネイルサロン',
		interval: 6000,
		title: '「ネイルサロン」のつぶやき',
		subject: 'ネイルサロン',
		width: 'auto',
		height: 300,
		theme: {
			shell: {
				background: '#ffcce0',
				color: '#ee5577'
			},
			tweets: {
				background: '#ffffff',
				color: '#444444',
				links: '#1985b5'
			}
		},
		features: {
			scrollbar: false,
			loop: true,
			live: true,
			hashtags: true,
			timestamp: true,
			avatars: true,
			toptweets: true,
			behavior: 'default'
		}
	}).render().start();


}





// twitter表示
function show_news() {

	new TWTR.Widget({
		version: 2,
		type: 'profile',
		rpp: 4,
		interval: 6000,
		width: 'auto',
		height: 150,
		theme: {
			shell: {
				background: '#66c8ef',
				color: '#ffff7f'
			},
			tweets: {
				background: '#ffffff',
				color: '#444444',
				links: '#009900'
			}
		},
		features: {
			scrollbar: true,
			loop: false,
			live: false,
			hashtags: true,
			timestamp: true,
			avatars: false,
			behavior: 'default'
		}
	}).render().setUser('nailsalon_bone').start();

}





// follow me 表示
function show_followme() {
	//<!-- twitter follow badge by go2web20 -->
	tfb.account = 'nailsalon_bone';
	tfb.label = 'follow-me';
	tfb.color = '#35ccff';
	tfb.side = 'r';
	tfb.top = 136;
	tfb.showbadge();
	//<!-- end of twitter follow badge -->
}





function slideSwitch() {
	var $active = jQuery('#shop_photo IMG.active');

	if ( $active.length == 0 ) $active = jQuery('#shop_photo IMG:last');

	var $next =  $active.next().length ? $active.next()
		: jQuery('#shop_photo IMG:first');

	$active.addClass('last-active');

	$next.css({opacity: 0.0})
		.addClass('active')
		.animate({opacity: 1.0}, 2000, function() {
		$active.removeClass('active last-active');
	});
}




