function fit_button(){

var cl_x=$("body").attr("clientWidth");
var cl_y=$("body").attr("clientHeight");
if(cl_x>1680){
$("#idxbox").css({width:'100%'});
var vtemp=(cl_x-1680)/2;
$("span").css({left:vtemp+5});
$("address").css({right:vtemp+5});
$("#footer").css({left:vtemp+5});
}else{
$("#idxbox").css({width:cl_x});
$("span").css({left:5});
$("address").css({right:5});
$("#footer").css({left:5});
}

if(cl_y<1200){
$("#idxbox").css({height:'100%'});

}

var but_x=Math.floor((cl_x-49)/2)-30;
var but_y=Math.floor((cl_y-29)/2)-130;
$("#idx_enter_button").css({left:but_x,bottom:but_y});

var but_x=Math.floor((cl_x-49)/2)-55;
var but_y=Math.floor((cl_y-29)/2)-100;
$("#idx_sub_button").css({left:but_x,top:but_y});

var but_x=Math.floor((cl_x-320)/2)-10;
var but_y=Math.floor((cl_y-60)/2)-10;
$("#kotowari").css({left:but_x,top:but_y});
$("#kotowari").css({display:(cl_x<780 || cl_y<560)?'block':'none'});

}

$(function(){
$(window).resize(fit_button);
fit_button();
});
