//jQuery(function($){ と書きだしている命令はIE+zenbackのバグ対策のため
	
//フッタカテゴリの高さ揃える
$(function() {
var maxHeight=0;
$("#footer .cat").each(function(){
if (maxHeight<$(this).height()){
maxHeight=$(this).height();
}
}).height(maxHeight);
});


//ページスクロール
$(function(){
$('a[href^=#]').click(function(){
var target;
target = $( $(this).attr('href') );
if (target.length == 0) {
return;
}
$('html, body').animate({scrollTop: target.offset().top});
return false;
});
});

//ページ送りON・OFF
$(function(){
$('#allPage').click(function(){
$('#allPage').css("display","none");
$('#allPageClose').css("display","block");
$('#allPageList').css("display","block");
});
$('#allPageClose').click(function(){
$('#allPageClose').css("display","none");
$('#allPageList').css("display","none");
$('#allPage').css("display","block");
});
});

//メニュー
$(function(){
$("#catMenu ul ul").hide();
//var isrc;
//isrc = $("#contents iframe[title='YouTube video player']:first").attr("src");
$("#catMenu li").hover(function(){
$("ul:not(:animated)",this).slideDown("fast");
//$("#contents iframe[title='YouTube video player']:first").attr("src","/common/iframe.html");
},
function(){
$("ul",this).slideUp("fast");
//$("#contents iframe[title='YouTube video player']:first").attr("src",isrc);
});
});

//stripeクラスのついている子要素をシマシマクラス追加
$(function () {
$(".stripe li:odd").addClass("odd");
});

//フォームの必須項目
$(function(){
$(".entryform #comment-author, .entryform #comment-text, .entryform #comment-email").val("必須項目です").css("color","#666").one("focus",function(){
$(this).val("").css("color","#000");
}).blur(function(){
if($(this).val()==""){
$(this).val("必須項目です").css("color","#666").one("focus",function(){
$(this).val("").css("color","#000");
});
}
});
});

//http://www.nishishi.com/javascript/2007/now-datetime.html
//日付変更
jQuery(function($){
var nowdate = new Date();
var year = nowdate.getFullYear(); // 年
var Heisei = nowdate.getFullYear() -1988; // 平成年
var mon  = nowdate.getMonth() + 1; // 月 
var date = nowdate.getDate(); // 日 
var week = nowdate.getDay(); // 曜日
var weekcharsJ = new Array( "日曜日", "月曜日", "火曜日", "水曜日", "木曜日", "金曜日", "土曜日" );
var todayweekJ = weekcharsJ[ week ];
var weekcharsE = new Array( "sun", "mon", "tue", "wed", "thu", "fri", "sat" );
var todayweekE = weekcharsE[ week ];
$('#header .ymdw .year').addClass("y"+year)
.text("平成" + Heisei + "年("+ year +"年)");
$('#header .ymdw .moon').addClass("m" + mon)
.text(mon +"月");
$('#header .ymdw .day').addClass("d" + date)
.text(date +"日");
$('#header .ymdw .weak').addClass(todayweekE)
.text(todayweekJ);
});

//ソーシャルボタン
jQuery(function($){
//$('#snsbutton #evernote').socialbutton('evernote', {
//button: 'article-clipper-jp',
//styling: 'full'
//});
//$('#snsbutton #hatena').socialbutton('hatena');
//$('#snsbutton #mixi_check').socialbutton('mixi_check', {
//key: '3430e160a197cd8a7192abcf3b734ce1c809438d'
//});
//$('#snsbutton #twitter').socialbutton('twitter', {
//button: 'horizontal',
//text: '',
//via: 'yasuo_kitajima'
//});
//$('#snsbutton #facebook_like').socialbutton('facebook_like', {
//button: 'button_count'
//});
//$('#snsbutton #google_plusone').socialbutton('google_plusone');

$('#snsbutton #twitter').socialbutton('twitter', {
button: 'horizontal',
text: '',
via: 'yasuo_kitajima'
});

$('#snsbutton #hatena').socialbutton('hatena');

$('#snsbutton #mixi_check').socialbutton('mixi_check', {
button: 'button-1',
key: '3430e160a197cd8a7192abcf3b734ce1c809438d'
});

$('#snsbutton #evernote').socialbutton('evernote', {
button: 'article-clipper-jp',
styling: 'full'
});

$('#snsbutton #facebook_like').socialbutton('facebook_like', {
button: 'button_count'
});

//Google+1はChromeで表示されなかったので、Googleから直接コード取りました
//$('#snsbutton #google_plusone').socialbutton('google_plusone', {
//lang: 'ja',
//size: 'medium',
//count: false
//});

});

//colorbox設定
jQuery(function($){
var subisrc;
subisrc = $("#sub2 iframe:first").attr("src");
$("a[rel='imageWindow']").colorbox();
$("a[rel='imageWindow']").click(function(){
$("#sub2 iframe:first").attr("src","/common/iframe.html");
});
$("#cboxClose").click(function(){
$("#sub2 iframe:first").attr("src",subisrc);
});

$(".movWindow").colorbox({iframe:true, innerWidth:425, innerHeight:344});//youtubeサイズ指定無しの動画URLの指定のみで可
$(".siteWindow").colorbox({width:"80%", height:"80%", iframe:true});//ページURL指定ものをiframeで表示
});


jQuery(function($){
$('#ieZenbackTaisaku').css("color","#000");
});
