function fit() {
	var isWin9X = (navigator.appVersion.toLowerCase().indexOf('windows 98')+1);
	var isIE = (navigator.appName.toLowerCase().indexOf('internet explorer')+1?1:0);
	var isOpera = (navigator.userAgent.toLowerCase().indexOf('opera')+1?1:0);
	if (isOpera) isIE = false;
	var isSafari = (navigator.appVersion.toLowerCase().indexOf('safari')+1?1:0);

	var obj = document.getElementById("backimg");
	var obj2 = document.getElementById("backbg");

	if (!isSafari && !isOpera) {
		winWidth = document.documentElement.clientWidth || document.body.clientWidth || document.body.scrollWidth;
		winHeight = document.documentElement.clientHeight || document.body.clientHeight || document.body.scrollHeight;
	} else {
		winWidth = window.innerWidth;
		winHeight = window.innerHeight;
	}

//	alert(winWidth);
//	alert(winHeight);
	if(winWidth > winHeight){
			obj.style.width = winWidth + "px";
			obj.style.height = "auto";
			obj2.style.width = winWidth + "px";
			obj2.style.height = winHeight + "px";

	}
	if(winWidth < winHeight){
			obj.style.width = "auto";
			obj.style.height = winHeight + "px";
			obj2.style.width = winWidth + "px";
			obj2.style.height = winHeight + "px";
	}
}

window.onresize = fit;
