/*
 * constant.js - お天気コーナー用 変数一覧
 *
 * ○概要
 * お天気コーナーで使用する情報の内、
 * 変更等の可能性がある内容を本ファイル内に変数として格納します。
 * 処理についてはweather.js内にて実施しております。
 *
 * ○変更履歴
 * 2010.04.23 h.adachi : 新規作成
 * 2010.04.27 h.adachi : CSVファイル関連 変数追加
 * 2010.04.28 h.adachi : 文言「きょう(あす)の天気」関連 変数追加
 * 2010.04.30 h.adachi : 気温一方のみ空の際の代替テキスト設定
 * 2010.06.29 h.adachi : 地域データ不在時の文言を変更
 * 2010.06.30 h.adachi : 地域コード変更処理関連変数の追加
 */

if ( typeof(Weather) == 'undefined' ) Weather = function() {};

/** 設定関連情報(基本的には触らない) */
// 都道府県名
Weather.prototype.PREFECTURE = new Array(
	'---'   , '北海道', '青森県', '秋田県', '岩手県', '宮城県', '山形県'  , '福島県',
	'茨城県', '栃木県', '群馬県', '埼玉県', '東京都', '千葉県', '神奈川県', '長野県',
	'山梨県', '静岡県', '愛知県', '岐阜県', '三重県', '新潟県', '富山県'  , '石川県',
	'福井県', '滋賀県', '京都府', '大阪府', '兵庫県', '奈良県', '和歌山県', '岡山県',
	'広島県', '島根県', '鳥取県', '山口県', '徳島県', '香川県', '愛媛県'  , '高知県',
	'福岡県', '大分県', '長崎県', '佐賀県', '熊本県', '宮崎県', '鹿児島県', '沖縄県'
);
// 都道府県コード(AA-BBは範囲指定)
Weather.prototype.PREF_CODE = new Array(
	''  , '11-24', '31', '32', '33', '34', '35', '36',
	'40', '41'   , '42', '43', '44', '45', '46', '48',
	'49', '50'   , '51', '52', '53', '54', '55', '56',
	'57', '60'   , '61', '62', '63', '64', '65', '66',
	'67', '68'   , '69', '81', '71', '72', '73', '74',
	'82', '83'   , '84', '85', '86', '87', '88', '91-94'
);
// 規則外コード
Weather.prototype.IRREGULAR_CD = new Array(
	{ 's_cd' : '61','area_cd' : '0400' },
	{ 's_cd' : '88','area_cd' : '1000' }
);

// cookie有効期限(年単位)
Weather.prototype.LIMIT_YEAR = 3;

/** 各種HTML(修正可) */
Weather.prototype.NOCOOKIE_TXT = '<div class="attention">このコンテンツを使用する場合は、Cookieを有効にしてください。</div>\n';
Weather.prototype.NOAREA_TXT   = '<option value="" id="area">地域がありません</option>\n';
Weather.prototype.NODATA_TXT   = '<div class="attention">右下の地域設定から<br />再設定をしてね。</div>\n';
Weather.prototype.IMG_INFO = {
	'width'  : { 'main' : 65, 'text' : 129, 'chara' : 145 },
	'height' : { 'main' : 64, 'text' : 28 , 'chara' : 132 },
	'prefix' : { 'main' : 'img_', 'text' : 'text_', 'chara' : 'chara_' },
	'suffix' : { 'main' : '.gif', 'text' : '.gif' , 'chara' : '.gif' },
	'dir'    : {
		'main'  : '/images/weather/',
		'text'  : '/images/weather/',
		'chara' : '/images/weather/'
	}
};
Weather.prototype.DAY_TEXT = {
	'today'    : '<div class="date2">きょうのお天気</div>\n',
	'tomorrow' : '<div class="date2">あすのお天気</div>\n'
};

/** 各種HTML(基本的には触らない) */
Weather.prototype.COOKIE_NAME  = 'area=';
Weather.prototype.NO_TEMP      = '--/--';
Weather.prototype.NO_TEMP_TEXT = '--';
Weather.prototype.DEFAULT_IMG  = '<img width="145" height="132" src="/images/weather/chara_.gif"/>';
Weather.prototype.DEFAULT_AREA = '<select name="area" id="area">\n<option value="" id="area">---</option>\n</select>\n';
Weather.prototype.RETURN_HTML  = '　|　<a href="#" onclick="weather.start(); return false;">地域設定</a>\n';
Weather.prototype.DIV_HTML = {
	'chara' : '<div class="chara" id="chara"></div>\n',
	'date'  : '<div class="date" id="date"></div>\n',
	'info'  : '<div id="weather_info">\n</div>\n'
};
Weather.prototype.BTN_HTML = {
	'select'   : '" onclick="Weather.regist();">設定</a>',
	'unselect' : '<span>設定</span>'
};
Weather.prototype.NOIMG_HTML = {
	'main' : '<div class="noimg" style="width:65px; height:64px; float:left; margin:0px 6px 0px 12px;"></div>\n',
	'text' : '<div class="noimg" style="width:129px; height:28px;"></div>\n'
};

/** CSV関連情報 */
// CSVファイルパス
Weather.prototype.DATA_PATH   = '/weather/csv/nns-otenki.csv';
Weather.prototype.LIST_PATH   = '/weather/data/tenki_list.csv';
Weather.prototype.REGION_PATH = '/weather/data/region';

// CSVデータ情報(値の部分が何フィールド目を示す ※0スタート)
Weather.prototype.DATA_FIELD = {
	'area_jp'    : 0,
	'area_cd'    : 1,
	'day'        : 2,
	'hour'       : 3,
	'weather_cd' : 4,
	'temp'       : 5
};
Weather.prototype.LIST_FIELD = {
	'weather_cd' : 0,
	'img_id'     : 1
};
Weather.prototype.REGION_FIELD = {
	'pref_cd'   : 0,
	'old_cd'    : 1,
	'new_cd'    : 2,
	'irrg_flag' : 3,
	'gove_flag' : 4
};
