﻿/* ================================================================ *
	jquery fadeエフェクト
 * ================================================================ */
/*
$(document).ready(function(){
$("img.fade-btn").fadeTo(0,1);
$("img.fade-btn").hover(function(){
        $(this).fadeTo(300,0);
    },
    function(){
        $(this).fadeTo(300,1);
    });
});
*/
$(document).ready(function(){
	$("div.block").hover(
		function() { $(this).animate({ backgroundColor: "#7cbd35" },500 );},
		function() { $(this).animate({ backgroundColor: "#dcdebc" },500 );}
	);
});


/* ================================================================ *
	スムーズスクロール
 * ================================================================ */

var url = "http://" + location.hostname + location.pathname;
$('a[@href*="#"]').click(function() {
	var id = this.href.substring(this.href.indexOf('#'),this.href.length);
	var hrefUrl = this.href.split(id);
	if(hrefUrl[0] == url) {
		if(id == '#header') {
			$('body').addClass('body');
			$('.body').ScrollTo('slow');
			$('body').removeClass();
			return false;
			}else{
			$(id).ScrollTo('slow');
			return false;
		}
	}
});

/*====================================================
テーブルカラー
====================================================*/

$(function(){
	//奇数trの背景色を変更
	$(".estate-table").each(function(){
		$(this).find("tr:even").addClass("even");
	});
	
});


/*====================================================
カレンダー
====================================================*/
var isIE = /*@cc_on!@*/false;
/*

$(document).ready(function() {
	createCalendar($('#now').val());
});

function createCalendar(date) {
	$('#c-cap').html('<span><img src="./img/icon/ajax-loader.gif" width="16" alt="Now Loading..." /></span>');
	$('#calendar').html('<tr><th>Now Loading...</th></tr>');
	$('#now').val(date);
	
	$.post(
		'./js/020_calendar.ajax',
		{'date': date},
		function(res) {
			res = eval(res);
			
			var count = 0;
			var table = '<tr class="week"><th>日</th><th>月</th><th>火</th><th>水</th><th>木</th><th>金</th><th>土</th></tr>';
			
			for (var i = 0; i < res.data.length; i++) {
				if (count == 0) table += '<tr>';
				
				table += '<td';
				if (res.data[i].cls) {
					table += ' class="'+res.data[i].cls+'"';
				}
				table += '>'+res.data[i].value+'</td>';
				
				if (count == 6) {
					count = 0;
					table += '</tr>';
				} else {
					count++;
				}
			}
			
			if (isIE) {
				document.getElementById('c-cap').innerHTML = res.cap;
			} else {
				$('#c-cap').html(res.cap);
			}
			$('#calendar').html(table);
		}
	);
}
*/
/*====================================================
画像フェード
====================================================*/

$(document).ready(function() {
	$('.gallery ul').add(".gallery ul li").hover(function() {
		$(this).siblings().stop().fadeTo(500,0.5);
	}, function() {
		$(this).siblings().stop().fadeTo(500,1);
	});
});



