<!--

function getOSType(){
    var uAgent  = navigator.userAgent.toUpperCase();
    if (uAgent.indexOf("MAC") >= 0) return "MacOS";
    if (uAgent.indexOf("WIN") >= 0) return "Windows";
    if (uAgent.indexOf("X11") >= 0) return "UNIX";
    return "";
}

function getBrowserName(){
	var aName  = navigator.appName.toUpperCase();
	var uName = navigator.userAgent.toUpperCase();
	if (uName.indexOf("SAFARI") >= 0){
		return "Safari";
	}else if(uName.indexOf("OPERA") >= 0){
		return "Opera";
	}else if(uName.indexOf("FIREFOX") >= 0){
		return "Firefox";
	}else if(aName.indexOf("MICROSOFT") >= 0){
		return "Explorer";
	}else if((aName.indexOf("NETSCAPE") >= 0)){
		return "Netscape";
	}else{
    return "";
	}
}


function windowSizeFix(numW,numH){
	if((getOSType()=='MacOS')&&(getBrowserName()=='Safari')){ numW +=15; numH +=91; };
	if((getOSType()=='MacOS')&&(getBrowserName()=='Firefox')){ numW +=15; numH +=117; };
	if((getOSType()=='MacOS')&&(getBrowserName()=='Explorer')){ numW +=37; numH +=109; };

	if((getOSType()=='Windows')&&(getBrowserName()=='Explorer')){ numW +=37; numH +=162; };
	if((getOSType()=='Windows')&&(getBrowserName()=='Firefox')){ numW +=33; numH +=152; };

	if(document.referrer.indexOf("bang-design.com")<0){
		self.resizeTo(numW,numH);
	}
}

function windowSizeFixNoScroll(numW,numH){
	originalW = numW;
	originalH = numH;
	if((getOSType()=='MacOS')&&(getBrowserName()=='Safari')){ numW +=0; numH +=70; };
	if((getOSType()=='MacOS')&&(getBrowserName()=='Firefox')){ numW +=0; numH +=66; };
	if((getOSType()=='MacOS')&&(getBrowserName()=='Explorer')){ numW +=22; numH +=109; };

	if((getOSType()=='Windows')&&(getBrowserName()=='Explorer')){ numW +=37; numH +=134; };
	if((getOSType()=='Windows')&&(getBrowserName()=='Firefox')){ numW +=17; numH +=118; };

	if(document.referrer.indexOf("bang-design.com")<0){
		self.resizeTo(numW,numH);
	}

	// documentの見えてる部分だけのサイズを取得;
	var windowVisibleWidth, windowVisibleHeight;
	if(self.innerHeight){
		// mac+safari, mac+firefox, win+firefox;
		//windowVisibleWidth = window.innerWidth;
		//windowVisibleHeight = window.innerHeight;
		windowVisibleWidth = document.documentElement.clientWidth;
		windowVisibleHeight = document.documentElement.clientHeight;
	}else if(typeof document.body.style.maxHeight != "undefined"){
		// win+ie7 (mac+safari, mac+firefox, win+firefox);
		windowVisibleWidth = document.documentElement.clientWidth;
		windowVisibleHeight = document.documentElement.clientHeight;
	}else{
		// win+ie6;
		windowVisibleWidth = document.body.clientWidth;
		windowVisibleHeight = document.body.clientHeight;
	}

	// 見えてる部分だけのサイズが指定よりもまだ小さいときウィンドウサイズを広げる;
	if((windowVisibleWidth < originalW) || (windowVisibleHeight < originalH)){
		numW +=(originalW - windowVisibleWidth);
		numH +=(originalH - windowVisibleHeight);
		// スクロールバーの分をwindowVisibleWidth,windowVisibleHeightに入れていないのでその分値をひく;
		if((getOSType()=='MacOS')&&(getBrowserName()=='Safari')){ numW -=15; numH -=15; };
		if((getOSType()=='MacOS')&&(getBrowserName()=='Firefox')){ numW -=15; numH -=15; };
		if((getOSType()=='MacOS')&&(getBrowserName()=='Explorer')){ numW -=15; numH -=15; };
		if((getOSType()=='Windows')&&(getBrowserName()=='Firefox')){ numW -=15; numH -=17; };

		if(document.referrer.indexOf("bang-design.com")<0){
			self.resizeTo(numW,numH);
		}
	}
}


// map/ contact用;
function mpWinOpn() {
	URLnam='http://bang-design.nsf.jp/map/login.cgi';
	numW=957;
	numH=639;

	if((getOSType()=='MacOS')&&(getBrowserName()=='Safari')){ numW +=0; numH +=0; };
	if((getOSType()=='MacOS')&&(getBrowserName()=='Firefox')){ numW +=0; numH +=3; };
	if((getOSType()=='MacOS')&&(getBrowserName()=='Explorer')){ numW +=0; numH +=0; };
	if((getOSType()=='Windows')&&(getBrowserName()=='Explorer')){ numW +=0; numH +=0; };
	if((getOSType()=='Windows')&&(getBrowserName()=='Firefox')){ numW +=0; numH +=0; };
	wnam='map_window'
	pointX = 30;
	pointY = 30;
	nwin = open(URLnam, wnam, "toolbar=0,location=0,directories=0,status=1,menubar=0,scrollbars=0,resizable=1,width=" + numW + ",height=" + numH + ",top=" + pointY +",left=" + pointX );
	// firefoxだと、すでにwindowがあった場合にfocusしないとwindowが前に出てこない;
	nwin.focus();

}

// -->
