$(function() {

/*	blogLink
-------------------------------------------------------------------------------- */

$("#blogLink").load(SCRIPT_PATH + '/rss/rssup.php');


/*	splash
-------------------------------------------------------------------------------- */

// drop shadow
$('#splashFrame').append('<div id="ds"></div>')
.append('<div id="ds_h_t"><div class="ds h1 o1"></div><div class="ds h2 o2"></div><div class="ds h3 o3"></div><div class="ds h4 o4"></div><div class="ds h5 o5"></div></div>')
.append('<div id="ds_h_b"><div class="ds h1 o1"></div><div class="ds h2 o2"></div><div class="ds h3 o3"></div><div class="ds h4 o4"></div><div class="ds h5 o5"></div></div>')
.append('<div id="ds_v_l"><div class="ds v1 o1"></div><div class="ds v2 o2"></div><div class="ds v3 o3"></div><div class="ds v4 o4"></div><div class="ds v5 o5"></div></div>')
.append('<div id="ds_v_r"><div class="ds v1 o1"></div><div class="ds v2 o2"></div><div class="ds v3 o3"></div><div class="ds v4 o4"></div><div class="ds v5 o5"></div></div>');

$("ul#splashImages").innerfade({
	animationtype: 'fade', // アニメーションの種類（slide or fade：デフォルト）
	speed: 2000, // フェイドスピード（ミリ秒 or slow,normal：デフォルト,fast）
	timeout: 20000, // フェイドにかかる時間（ミリ秒、2000：デフォルト）
	type: 'random', // スライドショーの種類（sequence：デフォルト or random）
	containerheight: '140px' //囲んだ要素の高さ、auto：デフォルト
});


/*	archiveList
-------------------------------------------------------------------------------- */

$('#archiveIndex span.count').after('<span id="showList" class="controlList quiet">タイトル一覧を見る</span><span id="hideList" class="controlList quiet">タイトル一覧を隠す</span>');

/* 初期化 */
$('#archiveIndex ul').hide();
$('#showList').show();
$('#hideList').hide();

/* クリック機能の設定 */
$("#showList").click(function(){
	$('#archiveIndex ul').slideDown("slow");
	$('#showList').hide();
	$('#hideList').show();
});
$("#hideList").click(function(){
	$('#archiveIndex ul').slideUp("slow");
	$('#showList').show();
	$('#hideList').hide();
});

/* リンク色の設定 */
$("#archiveIndex span.controlList").mouseover(function(){
	this.style.color = "#5b6d00";
	this.style.cursor = "pointer";
});
$("#archiveIndex span.controlList").mouseout(function(){
	this.style.color = "#777";
	this.style.cursor = "default";
});


/*	commentForm
-------------------------------------------------------------------------------- */

$("#comment").css('overflow', 'hidden').css('height', 100).bind("keyup", function(){
	var extraSpace = 30;
	var maxHeightLimit = parseInt($(window).height() * 0.7);
	var minHeightLimit = 70;
	$(this).css('height', minHeightLimit);
	var moderateHeight = Math.min(Math.max($(this).attr('scrollHeight'), minHeightLimit), maxHeightLimit) + extraSpace;
	$(this).css('height', moderateHeight);
	if (moderateHeight > maxHeightLimit) {
		$(this).css('overflow', 'auto');
	} else {
		$(this).css('overflow', 'hidden');
	}
});


/*	twitter
-------------------------------------------------------------------------------- */

getTwitters('tweets', {
	id: 'jenuine',
	count: 5,
	enableLinks: true,
	ignoreReplies: true,
	clearContents: true,
	template: '<span><a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a></span>%text%'
});



/*
	template: '%text% <a href="http://twitter.com/%user_screen_name%/statuses/%id%/">%time%</a>'
*/

/*
$('#header .contents').append('<div id="meigen"></div>');
getTwitters('meigen', {
	id: 'meigenbot',
	count: 1,
	enableLinks: false,
	ignoreReplies: true,
	clearContents: true,
	template: '%text%'
});
*/


/*	end
-------------------------------------------------------------------------------- */
});