/* #############################################################
#WEB_SITES_JS {
	--------------------------------------------
	#filename	: base.js
	#version    : 1.0;

	サイト内JavaScriptの管理ファイル
	--------------------------------------------
}

#CONTENT {
	--------------------------------------------
	+ 1: rollover function
	+ 2: stripe function
	+ 999: CSS set
	--------------------------------------------
}

############################################################# */


$(function(){
/* ==============================================================
	
	[+1:]
	rollover function
	for jQuery

============================================================== */
$('img.hov')
	.mouseover(function () {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
	})
	.mouseout(function () {
		this.src = this.src.replace(/^(.+)_hov(\.[a-z]+)$/, "$1$2");
	})
	.each(function () {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
});
$("input.hov")
	.mouseover(function () {
		this.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
	})
	.mouseout(function () {
		this.src = this.src.replace(/^(.+)_hov(\.[a-z]+)$/, "$1$2");
	})
	.each(function () {
		this.preloaded = new Image;
		this.preloaded.src = this.src.replace(/^(.+)(\.[a-z]+)$/, "$1_hov$2");
});

$('input[title]').each(function() {
	if($(this).val() === '') {
		$(this).val($(this).attr('title'));	
	}
		
	$(this).focus(function() {
		if($(this).val() == $(this).attr('title')) {
			$(this).val('').addClass('focused');	
		}
	});
	$(this).blur(function() {
		if($(this).val() === '') {
			$(this).val($(this).attr('title')).removeClass('focused');	
		}
	});
});



/*
※jQuery is necessary. 
■ボタンのロールオーバー用ファンクション(jQuery版)

【操作手順】
[1]ロールオーバー前用の画像を適当なファイル名で用意します。 例：btn.gif
[2]ロールオーバー時用の画像のファイル名末端に"_hov"と付けます。 例：btn_hov.gif
[3]設置するimg要素に class="hov" を指定します。
---------------------------------------------------------------
<img class="hov" src="../../common/js/img/btn.gif" alt="test" />
---------------------------------------------------------------
*/

/* ==============================================================
	
	[+2:]
	accordion function
	for jQuery

============================================================== */
	$(".accordion dt").hover(function(){
		$(this).css("cursor","pointer"); 
	},function(){
		$(this).css("cursor","default"); 
		});
	$(".accordion dd").css("display","none");
	$(".accordion dt").click(function(){
		$(this).next().slideToggle("fast");
		});



/* ==============================================================
	
	[+3:]
	common social plugin function
	for jQuery

============================================================== */

$('#g_htn').socialbutton('hatena', {
	url: 'http://hometown.ne.jp/',
	button: 'vertical'
});

$('#g_tw').socialbutton('twitter', {
	button: 'vertical',
	url: 'http://hometown.ne.jp/',
	text: '吉祥寺なんでもサイト ホームタウン吉祥寺',
	via: 'htown_kichijoji'
});

$('#g_gp').socialbutton('google_plusone', {
	lang: 'ja',
	url: 'http://hometown.ne.jp/',
	size: 'tall'
});

$('#g_fb').socialbutton('facebook_like', {
	url: 'http://hometown.ne.jp/',
	button: 'box_count'
});
	


});
//END "$(function()"




