$(document).ready(function(){

//$('.post_wr:last').css({'background-image':'url(null)'});


$('body').append("<div id='box_cnt'></div><div id='box_bg'></div>");
$('#box_bg,#box_cnt').click(function(){
$('#box_bg,#box_cnt').fadeOut(200);
});
/*
$('a[href*=".jpeg"], a[href*=".jpg"], a[href*=".gif"], a[href*=".png"], a[href*=".JPEG"], a[href*=".JPG"], a[href*=".GIF"], a[href*=".PNG"]').click(function(){
var winH = $(window).height();
var winW = $(window).width();
var id = $(this).attr("href");
$('#box_bg').fadeIn(200);
$('#box_bg,').fadeTo("slow",0.8);
//$('#box_cnt').css('top',  winH/2-$(id).height()/2);
//$('#box_cnt').css('left', winW/2-$(id).width()/2);
$('#box_cnt').css('top',  winH/2-winH/3);
$('#box_cnt').css('left', winW/2-175);
$('#box_cnt').fadeIn(500).html("<img src='"+$(this).attr("href")+"' /><h6 id='box_close'>CLOSE</h6>");
$('#box_cnt').fadeTo("slow",1);
return false;
});

if($.browser.msie && $.browser.version<7){
$(window).scroll(function(){
$('#box_bg').css('top',$(document).scrollTop());
$('#box_cnt').css('top',($(document).scrollTop()+$(window).height()/2) +'px');
});}
*/

/*
$(".jquery_tabs").accessibleTabs({
wrapperClass: 'content',
currentClass: 'current',
tabhead: 'h5',
tabbody: '.tabbody',
fx:'fadeIn',// can be 'fadeIn', 'slideDown', 'show'
fxspeed: 'normal',
// speed (String|Number): 'slow', 'normal', or 'fast') or the number of
// milliseconds to run the animation
currentInfoText: '',
// text to indicate for screenreaders which tab is the current one
currentInfoPosition: 'prepend',
// Definition where to insert the Info Text.
// Can be either 'prepend' or 'append'
currentInfoClass: 'current-info'
});
*/

$('.smartabs').find('h5').wrapAll("<ul class='tabs'></ul>");
$('.smartabs').find('h5').wrap("<li class='tabhead'></li>");
$('.smartabs').find('.tabhead').wrapAll("<div class='tabcontent'></div>");
$('.smartabs').find('.tabhead'+':first').addClass('current');
$('.smartabs').fadeIn(300);
$('.smartabs').find('.tabbody'+':first').show();
$('.smartabs').find('.tabhead').click(function(){
$('.current').removeClass('current');
$(this).addClass('current');
$('.tabbody').hide();
var tabbodyanchor = $(this).find('a').attr('title');
$('#'+tabbodyanchor).show();
return false;
});



//$('#contents h6').click(function () {
//$('#contents ul').slideToggle(10);
//});

$(function(){
$('.searchs input[value=""]').val("記事を検索する").css("color","#bbb");
$('.searchs input').focus(function(){
$(this).css("background-color" , "#fff");
if(this.value == "記事を検索する"){
$(this).val("").css("color","#000");
}
});
});

$('.targets a').bigTarget({
hoverClass: 'hovers', // CSS class applied to the click zone onHover
clickZone : 'div:eq(0)' // jQuery parent selector
});

//smooth scroll pagetop anchor
$('a[href*=#pagetop]').click(function(){
$(this).blur();
$('html,body').animate({ scrollTop: 0 }, 300);
return false;
});


});