// browser size fixed brobackground image script

function resizer(){
var imageWidth=1920, imageHeight=1280;

if(document.all){
	xscale = window.document.documentElement.clientWidth/imageWidth;
	yscale = window.document.documentElement.clientHeight/imageHeight;
}
else {
	xscale = window.innerWidth/imageWidth;
	yscale = window.innerHeight/imageHeight;
	}
	fixscale = Math.max(xscale, yscale);
	fixWidth = Math.ceil(imageWidth*fixscale);
	document.getElementById("bgimage").width = fixWidth;
	document.getElementById("bgimage").style.visibility = "visible";
	
	// センタリング処理
	parentWidth = window.innerWidth;
	
	if(fixWidth > parentWidth){
//		offset = -((fixWidth-parentWidth)/2); // センタリング
//		offset = -(fixWidth-parentWidth); // 右寄せ
		offset = 0;
		$("#bgimage").css('margin-left',offset);
	}
	
	// スクロールバー処理
	setScrollBar();
	
	// 背景表示
	$("#bg").css("opacity","1");
}
window.onload = resizer;
window.onresize = resizer;

$(document).ready(function(){
	setScrollBar();
});

function setScrollBar(){
	var w = $("#contentBase").width();
	var wVal = w - 15;
	
	var cBase = $("#contentBase").height();
	var cBody = $("#rightTab").height() + $("#leftTab").height() + $("#full").height();
	
	if(cBody>cBase){
		$("#header").css("width",wVal + "px");
		$("#footer").css("width",wVal + "px");
	}
}


