function GGSB() {
	var args = Array.prototype.slice.call(arguments),
		callback = args.pop(),
		modules = (args[0] && typeof args[0] === "string") ? args : args[0],
		i;
	
	this.ClubItems = {
		'ドライバー'		: { 'name' : 'driver',		's_name' : 'DW' },
		'フェアウェイ'		: { 'name' : 'fairway',		's_name' : 'FW' },
		'ユーティリティ'	: { 'name' : 'utility',		's_name' : 'UT' },
		'ウェッジ'			: { 'name' : 'wedge',		's_name' : 'WG' },
		'アイアン'			: { 'name' : 'iron',		's_name' : 'IR' },
		'パター'			: { 'name' : 'putter',		's_name' : 'PT' }
	};
	
	this.ClubTypes = {
		'DW' : 1 << 0,
		'FW' : 1 << 1,
		'UT' : 1 << 2,
		'IR' : 1 << 3,
		'WG' : 1 << 4,
		'PT' : 1 << 5
	};
	
	this.PointItems = {
		"vision" : [
			{ "id" : "1"	, "title" : "ポイント1",		"icon" : "flag" },
			{ "id" : "2"	, "title" : "ポイント2",		"icon" : "flag" },
			{ "id" : "3"	, "title" : "ポイント3",		"icon" : "flag" },
			{ "id" : "4"	, "title" : "ポイント4",		"icon" : "flag" },
			{ "id" : "5"	, "title" : "ポイント5",		"icon" : "flag" },
//			{ "id" : "6"	, "title" : "ポイント6",		"icon" : "flag" },
			{ "id" : "7"	, "title" : "谷手前",			"icon" : "flag" },
			{ "id" : "8"	, "title" : "谷越え",			"icon" : "flag" },
			{ "id" : "9"	, "title" : "右ドッグレッグ",	"icon" : "rightdogleg" },
			{ "id" : "10"	, "title" : "左ドッグレッグ",	"icon" : "flag" },
//			{ "id" : "13"	, "title" : "池手前",			"icon" : "frontpond" },
//			{ "id" : "14"	, "title" : "池越え",			"icon" : "flag" },
			{ "id" : "15"	, "title" : "右バンカー手前",	"icon" : "flag" },
			{ "id" : "16"	, "title" : "右バンカー越え",	"icon" : "flag" },
			{ "id" : "17"	, "title" : "中央バンカー手前",	"icon" : "centerbanker" },
			{ "id" : "18"	, "title" : "中央バンカー越え",	"icon" : "centerbanker" },
			{ "id" : "19"	, "title" : "左バンカー手前",	"icon" : "flag" },
//			{ "id" : "20"	, "title" : "左バンカー越え",	"icon" : "leftbanker" },
			{ "id" : "24"	, "title" : "右の木",			"icon" : "righttree" },
			{ "id" : "25"	, "title" : "中央の木",			"icon" : "flag" },
			{ "id" : "26"	, "title" : "左の木",			"icon" : "flag" },
			{ "id" : "27"	, "title" : "木のフロント",		"icon" : "fronttree" },
			{ "id" : "28"	, "title" : "木のオーバー",		"icon" : "overtree" },
//			{ "id" : "31"	, "title" : "ポイント7",		"icon" : "flag" },
			{ "id" : "32"	, "title" : "ポイント8",		"icon" : "flag" }
		],
		"view" : [
			{ "id" : "1"	, "title" : "ポイント1",		"icon" : "flag" },
			{ "id" : "2"	, "title" : "ポイント2",		"icon" : "flag" },
			{ "id" : "3"	, "title" : "ポイント3",		"icon" : "flag" },
			{ "id" : "4"	, "title" : "ポイント4",		"icon" : "flag" },
			{ "id" : "7"	, "title" : "谷手前",			"icon" : "flag" },
			{ "id" : "9"	, "title" : "右ドッグレッグ",	"icon" : "rightdogleg" },
			{ "id" : "10"	, "title" : "左ドッグレッグ",	"icon" : "flag" },
			{ "id" : "13"	, "title" : "池手前",			"icon" : "frontpond" },
			{ "id" : "14"	, "title" : "池越え",			"icon" : "flag" },
			{ "id" : "15"	, "title" : "右バンカー手前",	"icon" : "flag" },
			{ "id" : "17"	, "title" : "中央バンカー手前",	"icon" : "centerbanker" },
			{ "id" : "18"	, "title" : "中央バンカー越え",	"icon" : "centerbanker" },
			{ "id" : "19"	, "title" : "左バンカー手前",	"icon" : "flag" },
			{ "id" : "20"	, "title" : "左バンカー越え",	"icon" : "leftbanker" },
			{ "id" : "24"	, "title" : "右の木",			"icon" : "righttree" },
			{ "id" : "26"	, "title" : "左の木",			"icon" : "flag" }
		]
	};
	
	this.strategyIconSuffix = {
		'view' : '.png',
		'vision' : 'c.jpg'
	};
	
	
	this.HinList = [
		'HIN_AVERAGE',
		'HIN_EAGLE',
		'HIN_BIRDY',
		'HIN_PAR',
		'HIN_BOGGY',
		'HIN_D_BOGGY',
		'HIN_OVER_3'
	];
	
	this.getMapCenter = function(map, point) {
		var pixel = map.convertPoint2Pixel(point, 1),
			tmp;
		
		var dom = $('#PopShotIndex');
		if (dom.length == 0) {
			dom = $('#PopShotIndexS');
		}
		
		if (dom.length > 0) {
			pixel.x -= dom.width() / 2;
		} else {
			return point;
		}
		
		tmp = map.convertPixel2Point(pixel, 1);
		
		
		tmp.mx = ZdcCommon.DEG2MS(tmp.lon);
		tmp.my = ZdcCommon.DEG2MS(tmp.lat);
		
		point.lat = tmp.lat;
		point.lon = tmp.lon;
		point.mx = tmp.mx;
		point.my = tmp.my;
		
		return point;
	};
	
	
	this.getIndexFromHoleNum = function(holeNum) {
		var targetTable = $('#HolenumSelected');
		if (!targetTable) {
			return null;
		}
		
		targetTable.find('tr:nth-child(2)>th:not(:first)>th').each(function(i) {
			if ($(this).find('span.holeNo').html() == holeNum) {
				return i;
			}
		});
		
		return null;
	};
	
	
	
	this.showCoverMapNoData = function() {
		if ($('#MapCoverNoData').length > 0) {
			$('#MapCoverNoData').fadeIn('fast');
			return ;
		}
		
		$('#MapLoading').clone().attr('id', 'MapCoverNoData').empty()
			.css('top', 0)
			.css('position', 'absolute')
			.css('width', 880)
			.css('background', 'url(/content/images/common/parts/loading/bg-loading-map.png)')
			.css('z-index', 500)
			.append($('<div class="text"/>')
				.html('ホールが登録されていません')
				.css('margin-top', $('#MapLoading').height() / 2)
				.css('text-align', 'center')
				.css('color', '#FFF')
			)
			.appendTo('#MapWrapp').fadeIn('fast');
	};
	
	
	
	this.hideCoverMapNoData = function() {
		if ($('#MapCoverNoData').length > 0) {
			$('#MapCoverNoData').fadeOut('fast');
		}
	};
	
	
	
	if (!(this instanceof GGSB)) {
		return new GGSB(modules, callback);
	}
	
	if (!modules || modules === "*") {
		modules = [];
		for (i in GGSB.modules) {
			if (GGSB.modules.hasOwnProperty(i)) {
				modules.push(i);
			}
		}
	}
	
	for (i = 0; i < modules.length; i++) {
		GGSB.modules[modules[i]](this);
	}
	
	callback(this);
}


GGSB.modules = {};


