// ウィンドウを開く（静的ページ用）
function MM_openBrWindow(theURL,winName,features) {
	$win = window.open(theURL,winName,features);
	$win.focus();
}

// ウィンドウを閉じる
function CloseWin(){
	window.close();
}

// ウィンドウを開く
function winOpen($url, $name, $options){
	// SafariとChromeの場合、現在のウィンドウからフォーカスを外す
//	if( navigator.userAgent.indexOf('AppleWebKit/') > -1 ) {
//		window.blur();
//	}
	$win = window.open($url, $name, $options);
	$win.focus();
	return $win;
}

// ウィンドウの幅を取得
function getWindowWidth(){
    if(window.innerWidth){
        return window.innerWidth;
    }else if(document.documentElement && document.documentElement.clientWidth){
        return document.documentElement.clientWidth;
    }else if ( document.body && document.body.clientWidth){
        return document.body.clientWidth;
    }
}
// ウィンドウの高さを取得
function getWindowHeight(){
    if(window.innerHeight){
        return window.innerHeight;
    }else if(document.documentElement && document.documentElement.clientHeight){
        return document.documentElement.clientHeight;
    }else if ( document.body && document.body.clientHeight){
        return document.body.clientHeight;
    }
}

// Infomation用
function openInfoWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=400, height=300";
	winOpen($url, "_blank", $options);
}

// 地図ページ用
function openMapWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=680";
	winOpen($url, "_blank", $options);
}

// お知らせ情報用
function openAnnounceWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=600, height=400";
	winOpen($url, "announce", $options);
}

// お知らせ一覧用
function openAnnListWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=600";
	winOpen($url, "annList", $options);
}

// 旬の味詳細ページ用
function openGourmetWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=550, height=720";
	winOpen($url, "_blank", $options);
}

// やどレシピ詳細ページ用
function openRecipeWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=720, height=800";
	winOpen($url, "_blank", $options);
}

// e-DataBank詳細ページ用
function openEdbWindow($url) {
	$options = "toolbar=no, status=yes, menubar=no, scrollbars=yes, resizable=yes, width=600, height=720";
	winOpen($url, "_blank", $options);
}

// 施設ブログページ用
function openBlogWindow($url) {
	$width = Math.max( 800, (screen.width * 0.8) );
	$height = Math.max( 600, (screen.height * 0.8) );
	$options = "toolbar=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes" + ", width=" + $width + ", height=" + $height;
	winOpen($url, "_blank", $options);
}

// 施設詳細ページ用
function openYadoWindow($url, $target) {
	$options = "toolbar=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes";
	winOpen($url, $target, $options);
}

function setFocusYadoWindow($target) {
	$options = "toolbar=yes, status=yes, menubar=yes, scrollbars=yes, resizable=yes";
	winOpen("", $target, $options);
}