/*  SJIS

2006/11/02　支社をまたがる選択がなされた時に、東京支社の”その他”を消す
2007/02/23　熊本支社->福岡支社統合の為、旧熊本支社の支社コードを"06"とする(office_cd[])
2007/11/15　広島支社->大阪支社に際して、本ファイル内の支社コードの変更は行わない
          ->旧広島支社エリアの県を選択した場合は、統合後も旧広島エリアの媒体を表示する為 
2005/06/30　旧広島支社エリアの媒体表示を大阪支社のものに変更
*/

var office_code;
office_code = new Array();
office_code['北海道'] = '01';
office_code['宮城県'] = '02';
office_code['岩手県'] = '02';
office_code['山形県'] = '02';
office_code['福島県'] = '02';
office_code['秋田県'] = '02';
office_code['青森県'] = '02';
office_code['東京都'] = '03';
office_code['神奈川県'] = '03';
office_code['埼玉県'] = '03';
office_code['千葉県'] = '03';
office_code['茨城県'] = '03';
office_code['静岡県'] = '08';
office_code['栃木県'] = '03';
office_code['群馬県'] = '03';
office_code['新潟県'] = '03';
office_code['愛知県'] = '04';
office_code['岐阜県'] = '04';
office_code['三重県'] = '04';
office_code['長野県'] = '04';
office_code['富山県'] = '05';
office_code['山梨県'] = '03';
office_code['大阪府'] = '05';
office_code['兵庫県'] = '05';
office_code['京都府'] = '05';
office_code['奈良県'] = '05';
office_code['滋賀県'] = '05';
office_code['和歌山県'] = '05';
office_code['広島県'] = '05';   // 2009/06/30 '09'->'05'
office_code['岡山県'] = '05';   // 2009/06/30 '09'->'05'
office_code['石川県'] = '05';
office_code['福井県'] = '05';
office_code['鳥取県'] = '05';   // 2009/06/30 '09'->'05'
office_code['島根県'] = '05';   // 2009/06/30 '09'->'05'
office_code['徳島県'] = '05';   // 2009/06/30 '09'->'05'
office_code['愛媛県'] = '05';   // 2009/06/30 '09'->'05'
office_code['香川県'] = '05';   // 2009/06/30 '09'->'05'
office_code['高知県'] = '05';   // 2009/06/30 '09'->'05'
office_code['福岡県'] = '06';
office_code['山口県'] = '06';
office_code['佐賀県'] = '06';
office_code['長崎県'] = '06';
office_code['熊本県'] = '06';   // 2007/02/23 '10'->'06'
office_code['大分県'] = '06';
office_code['宮崎県'] = '06';   // 2007/02/23 '10'->'06'
office_code['鹿児島県'] = '06'; // 2007/02/23 '10'->'06'
office_code['沖縄県'] = '07';


/* 支社ごとの媒体切り替え用関数 */
var ID_old = null;
function selectmedia() {
    //地域取得（都道府県名）
	var area = document.getElementById('pulldown').value;
	ID_new = office_code[area];
	
    //媒体非表示
    //前回の地域が未選択ならスルー
    //前回と同一支社の地域が選択されたらスルー
    //支社をまたがる地域変更時にチェックを外す
	if (ID_old != null  &&  ID_old != ID_new) {
		document.getElementById(ID_old).style.display = 'none';

        var obj = document.getElementsByName('baitai');
		for (i=0; i<obj.length; i++) {
			obj[i].checked = false;
		}
// 2006/11/02 ”その他”を選択したときのテキストもクリアする
		obj = document.getElementsByName('baitai2');
		obj[0].value = '';
    }
    
    //媒体表示
    //現在表示している支社コードを記憶
    //再表示時用
	if (area != "") {
    	document.getElementById(ID_new).style.display = '';
    	ID_old = ID_new;
    } else {
    }
}
