// JavaScript Document

// サブウィンドウの大きさと開く位置の指定
l = 60; // 表示するx座標
t = 30; // 表示するy座標
lwidth = 580; // 会員ログイン横幅
lheigh = 330; // 会員ログイン縦幅
rwidth = 670; // 楽天KC横幅
rheigh = 530; // 楽天KC縦幅
kwidth = 950; // 加盟店詳細横幅
kheigh = 650; // 加盟店詳細縦幅
mwidth = 670; // Map横幅
mheigh = 900; // Map縦幅
iwidth = 790; // インフォメーション詳細横幅
iheigh = 550; // インフォメーション詳細縦幅

// 会員ログインOpen
function openLogin() {
  x = (screen.width - lwidth) / 2;
  y = (screen.height - lheigh) / 2;
  subWin = window.open("memberlogin.html","OpenWindow",
    "screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+lwidth+",height="+lheigh);
}

// 楽天KC子画面Open
function openRakuten() {
  x = (screen.width - rwidth) / 2;
  y = (screen.height - rheigh) / 2;
  subWin = window.open("http://www.symons.co.jp/rakutenkc.php","OpenWindow",
    "screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+rwidth+",height="+rheigh);
}

// 加盟店詳細子画面
function openKamei(url) {
  x = (screen.width - kwidth) / 2;
  y = (screen.height - kheigh) / 2;
  subWin = window.open(url,"OpenWindow",
    "screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+kwidth+",height="+kheigh);
}

//MAP(会社概要地図)子画面
function openMap() {
  x = (screen.width - mwidth) / 2;
  y = (screen.height - mheigh) / 2;
  subWin = window.open("map.php","OpenWindow",
    "screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+mwidth+",height="+mheigh);
}

// インフォメーション詳細子画面
function openInfo(url) {
  x = (screen.width - iwidth) / 2;
  y = (screen.height - iheigh) / 2;
  subWin = window.open(url,"OpenWindow",
    "screenX="+x+",screenY="+y+",left="+x+",top="+y+",width="+iwidth+",height="+iheigh);
}


//Open位置指定なし
////function openWindow() {
////  window.open("sample.html","OpenWindow",
////    "screenX="+l+",screenY="+t+",left="+l+",top="+t+",width="+w+",height="+h);
////}


//ウィンドウクローズ
function WindowClose(){
	window.opener=null;
	window.close();
}

//子画面リンクを親画面へ反映させる
// リンクの処理開始
function parentsDisp(url){

	if(!window.opener || window.opener.closed){ // メインウィンドウの存在をチェック

//		window.alert('メインウィンドウがありません'); // 存在しない場合は警告ダイアログを表示

	}
	else{

		window.opener.location.href = url; // 存在する場合はページを切りかえる

	}

}
// 「戻る」「進む」ボタンを設けた場合の処理
function parentsHist(goback){

	if(!window.opener || window.opener.closed){ // メインウィンドウの存在をチェック

//		window.alert('メインウィンドウがありません'); // 存在しない場合は警告ダイアログを表示

	}
	else if(goback == 'back'){

		window.opener.history.back(); // 戻る

	}
	else if(goback == 'next'){

		window.opener.history.forward(); // 進む

	}

}
//子画面に以下HTML追加で「戻る」「進む」処理実行
//<a href="#" onClick="hist('back'); return false;">＜ 戻る</a>
//<a href="#" onClick="hist('next'); return false;">進む ＞</a>

// 加盟店検索画面へ
function changeURL(tiki_val, cate_val) {
	location.href  = "search.php?tiki="+tiki_val+"&city_list=0&category="+cate_val+"&genre_list=0&search2=";
}


