var ua = navigator.userAgent;
var bFox = ua.indexOf("Firefox") != -1;
var bSafari = ua.indexOf("Safari") != -1;
var bOpera = ua.indexOf(" Opera") != -1;
var bIE = ua.indexOf("MSIE") != -1;
//var bNetscape = ua.indexOf("Netscape") != -1;

var bXP = false;

var pos = ua.indexOf("NT");
if(pos != -1){
	var _os = Number(ua.substr(pos+3, 3));
	bXP = _os >= 5.1;
}

//スクロールなし。
function openNoScWin(wUrl, wWidth, wHeight){
	var wObj;
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	wOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	sWinName = "Contents";
	wObj = window.open(wUrl,sWinName,wOption);
	wObj.focus();
}


//スクロールあり。
function openScWin( wUrl, wWidth, wHeight){
	var wObj;
	if(navigator.appVersion.indexOf("Mac") > -1){
		if(bIE && !bOpera){
			wWidth -= 1;
		} else if(bSafari){
			wWidth += 15;
			wHeight += 1;
		}else if(bFox){
			wWidth += 15;
		}else{
			wWidth += 15;
		}
	} else{
		if(bXP){
			if(bIE && !bOpera){
				wWidth += 17;
			} else if(bFox){
				wWidth += 19;
			}else{
				wWidth += 17;
			}
		}else{
			if(bIE && !bOpera){
				wWidth += 16;
			} else if(bFox){
				wWidth += 16;
			}else{
				wWidth += 16;
			}
		}
	}
	scWidthCenter = screen.availWidth / 2;
	scHeightCenter = screen.availHeight / 2;
	wOption = "width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2)) + ",scrollbars=yes";
	wObj = window.open(wUrl, "SideStory", wOption);
	wObj.focus();
}

