// JavaScript Document

var bFox = navigator.userAgent.indexOf("Firefox") != -1;
var bSafari = navigator.userAgent.indexOf("Safari") != -1;
var bNN = navigator.userAgent.indexOf("Netscape") != -1;
var bIE = navigator.appName.charAt(0) == "M"? true: false;
var bMac = navigator.appVersion.indexOf("Mac") > -1? true: false;

var wObj;
var scWidthCenter = screen.availWidth / 2;
var scHeightCenter = screen.availHeight / 2;

function openWin(wUrl,sWinName,sScroll){
	wOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=" + sScroll + ",resizable=no,width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	wObj = window.open(wUrl,sWinName,wOption);
	wObj.focus();
}

//headerNavi Popup Only
function openWin2(wUrl,sWinName,sResize){
	wOption = "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=" + sResize + ",width=" + wWidth + ",height=" + wHeight + ",left=" + (scWidthCenter - (wWidth / 2)) + ",top=" + (scHeightCenter - (wHeight / 2));
	wObj = window.open(wUrl,sWinName,wOption);
	wObj.focus();
}


function openChintaiWin(){
	wWidth = 740;
	wHeight = 540;
	wUrl = "http://www.devex.co.jp/chintai/chintai.cgi";
	sWinName = "Chintai";
	openWin2(wUrl,sWinName,"yes");
}

//map Popup Only
function openMapWin(wUrl){
	wWidth = 568;
	wHeight = 651;
	sWinName = "Map";
	openWin(wUrl,sWinName,"no");
}

//project Popup Only
function openProWin(wUrl){
	wWidth = 425;
	wHeight = 580;
	if(bMac){
		if(bIE){
			wWidth = 409;
		}
	}else{
		if(bIE){
			wWidth = 426;
		}else if(bFox){
			wWidth = 427;
		}
	}
	sWinName = "Project";
	openWin(wUrl,sWinName,"yes");
}

//project urbyl Popup Only
function openProUrbylWin(wUrl){
	wWidth = 605;
	wHeight = 392;
	sWinName = "Urbyl";
	openWin(wUrl,sWinName,"no");
}

//news Popup Only
function openNewsWin(wUrl){
	wWidth = 425;
	wHeight = 480;
	if(bMac){
		if(bIE){
			wWidth = 409;
		}
	}else{
		if(bIE){
			wWidth = 426;
		}else if(bFox){
			wWidth = 427;
		}
	}
	sWinName = "News";
	openWin(wUrl,sWinName,"yes");
}


function CloseWin(){
    window.close();
}
