//	コンストラクタ
function AreaList(check) {
	this.check    = check;
	this.hokkaido = [  1 ];
	this.tohoku   = [  2,  3,  4,  5,  6,  7 ];
	this.kanto    = [  8,  9, 10, 11, 12, 13, 14, 15, 16 ];
	this.shinetsu = [ 17, 18 ];
	this.hokuriku = [ 19, 20, 21 ];
	this.tokai    = [ 22, 23, 24, 25 ];
	this.kinki    = [ 26, 27, 28, 29, 30, 31 ];
	this.chugoku  = [ 32, 33, 34, 35, 36 ];
	this.shikoku  = [ 37, 38, 39, 40 ];
	this.kyusyu   = [ 41, 42, 43, 44, 45, 46, 47 ];
	this.okinawa  = [ 48 ];
	this.all      = [ , this.hokkaido, this.tohoku, this.kanto, 
	                  this.shinetsu, this.hokuriku, this.tokai,
	                  this.kinki, this.chugoku, this.shikoku, 
	                  this.kyusyu, this.okinawa ];
}

AreaList.prototype = {
	// 初期化
	init : function () {
		var id = this.check;
		if ($("#" + id)==null) {
			return;
		}
		
		$("#" + id).click(function(){
			var area = this[this.selectedIndex].value;
			new AreaList(id).checkArea(area);
		});
	},
	
	checkArea : function (area) {
		var idArray = this.all[area];

		if (area=='') {
			return;
		}
		
		var count = 1;
		while (count<=48) {
			$('#area' +  count).removeAttr('checked');
			count++;
		}
		
		for (var i = 0; i<idArray.length; i++) {
			$('#area' +  idArray[i]).attr('checked', 'checked');
		}
		
		
	}
}