/****************************
*SBM Font Size Toggle Switch*
*ver 1.0 2009.10.09         *
****************************/


var SBMbizFontSize,fsFlag=0,fsCookie,fsReg,btnPosition;
var nowLocation = window.location.pathname;
if(nowLocation.match(/\/$/))nowLocation+='index.html';


// Button position.(case 'URL':btnPosition=[RIGHT,TOP];)
switch (nowLocation){
	case '/biz/bizface/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/about/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/case/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/case/ank.html':btnPosition=[159,10];break;
	case '/biz/bizface/case/nsj.html':btnPosition=[159,10];break;
	case '/biz/bizface/case/tn.html':btnPosition=[159,10];break;
	case '/biz/bizface/demo/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/faq/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/feature/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/function/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/priceplan/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/product/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/recommended/index.html':btnPosition=[159,10];break;
	case '/biz/bizface/recommended/list.html':btnPosition=[159,10];break;
	case '/biz/bizface/recommended/entry.html':btnPosition=[159,10];break;
	case '/biz/bizface/information.html':btnPosition=[617,10];break;
	default:btnPosition=[0,4];break;
}


// Font size and Button setting.
var fsConf =
[{
	'size':12,
	'position':0
},{
	'size':16.8,
	'position':-26
}];


// Load Cookie.
fsReg = document.cookie.match(/SBMbizFontSize=(\d)/);
SBMbizFontSize=(fsReg != null)?fsReg[1]:0;


// Set Switch.
document.write('<style>html body{font-size:'+fsConf[SBMbizFontSize].size+'px;}#font-size-switch{height:0px;overflow:visible;position:absolute;top:0px;left:0px;width:100%;}#font-size-switch div{position:relative;width:960px;margin:0 auto;background:red;height:0px;overflow:visible;}#font-size-switch p{position:absolute;right:'+btnPosition[0]+'px;top:'+btnPosition[1]+'px;width:124px;height:26px;cursor:pointer;overflow:hidden;}#fssbtn{position:relative;top:'+fsConf[SBMbizFontSize].position+'px;}</style>');
document.write('<div id="font-size-switch"><div><p onclick="fsCookie()"><img src="/biz/shared/img/general/btn_fss.gif" alt="文字サイズ切り替え" width="124" height="52" id="fssbtn" /></p></div></div>');


// Font size toggle and Save Cookie.
function fsCookie(){
	SBMbizFontSize = (SBMbizFontSize==0)?1:0;
	document.body.style.fontSize = fsConf[SBMbizFontSize].size + 'px';
	document.getElementById("fssbtn").style.top = fsConf[SBMbizFontSize].position + 'px';
	document.cookie = 'SBMbizFontSize=' + SBMbizFontSize + ';expires=Tue, 1-Jan-2030 00:00:00 GMT;path=/biz/';
}




