﻿google.load("jquery", "1");
google.setOnLoadCallback(function() {
$(function() {

var expireDate = new Date;
expireDate.setMonth(expireDate.getMonth() + 6); // クッキーを6ヶ月間保存

// クッキーの有無を調べる
if (document.cookie == "") {
var fontSize = "font-middle";
document.cookie = "fontSize=" + fontSize + "; path=/; expires=" + expireDate.toGMTString();
}
else {
fontSize = document.cookie;

switch(fontSize){
//文字サイズ（小）
case "fontSize=font-small":
$("body").removeAttr("class");
$("body").addClass("font-small");
$("#font_small img").attr("src","/img/common/font_small_on.gif");
$("#font_middle img").attr("src","/img/common/font_middle_off.gif");
$("#font_large img").attr("src","/img/common/font_large_off.gif");
break;

//文字サイズ（中）
case "fontSize=font-middle":
$("body").removeAttr("class");
$("body").addClass("font-middle");
$("#font_small img").attr("src","/img/common/font_small_off.gif");
$("#font_middle img").attr("src","/img/common/font_middle_on.gif");
$("#font_large img").attr("src","/img/common/font_large_off.gif");
break;

//文字サイズ（大）
case "fontSize=font-large":
$("body").removeAttr("class");
$("body").addClass("font-large");
$("#font_small img").attr("src","/img/common/font_small_off.gif");
$("#font_middle img").attr("src","/img/common/font_middle_off.gif");
$("#font_large img").attr("src","/img/common/font_large_on.gif");
break;

//その他
default:
break;
}
}


//文字サイズ変換（小）
$("#font_small img").click(function(){
$("body").removeAttr("class");
$("body").addClass("font-small");
$("#font_small img").attr("src","/img/common/font_small_on.gif");
$("#font_middle img").attr("src","/img/common/font_middle_off.gif");
$("#font_large img").attr("src","/img/common/font_large_off.gif");
fontSize = "font-small";
document.cookie = "fontSize=" + fontSize + "; path=/; expires=" + expireDate.toGMTString();
return false;
});

//文字サイズ変換（中）
$("#font_middle img").click(function(){
$("body").removeAttr("class");
$("body").addClass("font-middle");
$("#font_small img").attr("src","/img/common/font_small_off.gif");
$("#font_middle img").attr("src","/img/common/font_middle_on.gif");
$("#font_large img").attr("src","/img/common/font_large_off.gif");
fontSize = "font-middle";
document.cookie = "fontSize=" + fontSize + "; path=/; expires=" + expireDate.toGMTString();
return false;
});

//文字サイズ変換（大）
$("#font_large img").click(function(){
$("body").removeAttr("class");
$("body").addClass("font-large");
$("#font_small img").attr("src","/img/common/font_small_off.gif");
$("#font_middle img").attr("src","/img/common/font_middle_off.gif");
$("#font_large img").attr("src","/img/common/font_large_on.gif");
fontSize = "font-large";
document.cookie = "fontSize=" + fontSize + "; path=/; expires=" + expireDate.toGMTString();
return false;
});


//弁護士一覧（山口地区）
$("#lawyer_yamaguchi").load("../list/lawyer_yamaguchi.html");

//弁護士一覧（下関地区）
$("#lawyer_shimonoseki").load("../list/lawyer_shimonoseki.html");

//弁護士一覧（周南地区）
$("#lawyer_shuunan").load("../list/lawyer_shuunan.html");

//弁護士一覧（宇部地区）
$("#lawyer_ube").load("../list/lawyer_ube.html");

//弁護士一覧（岩国地区）
$("#lawyer_iwakuni").load("../list/lawyer_iwakuni.html");

//弁護士一覧（萩・長門地区）
$("#lawyer_haginagato").load("../list/lawyer_haginagato.html");


//ページスクロール
$("#page-top a").click(function(){
$("html,body").animate({ scrollTop: $($(this).attr("href")).offset().top }, "slow","swing");
return false;
});

$(".ico06 a").click(function(){
$("html,body").animate({ scrollTop: $($(this).attr("href")).offset().top }, "slow","swing");
return false;
});


});
});
