/**=========================================

 filename:  init.page.access.js
 create:    2009/
 copyright: 

　ページ初期化

=========================================*/
(function(){
$(function()
{
	/**
	 * shadowboxの初期化
	 * 
	 */
	Shadowbox.init({
		language:   "ja",
		players:    ['html' , 'iframe']
	});
	
	
	/**
	 * タブ機能
	 * google mapとイラストの切り替え
	 * 
	 * googlemapAPIたたくためのキーとか
	 * 設定情報とか
	 * ピン位置の画像とか
	*/
	var map = null;
	var geocoder = null;
	var address = null;
	
	load( top_assigned_obj.map_address );
	function load(address){
		
		if( top_assigned_obj == null || top_assigned_obj == undefined || top_assigned_obj == "" ) return;
		if(address == null || address == undefined || address == "" ) return;
		if( $("#googleMap").size() == 0 ) return;
		
		var keido	= address.split( "," )[ 0 ];
		var ido		= address.split( "," )[ 1 ];
		
		if (GBrowserIsCompatible()) {
			map = new GMap2(document.getElementById("googleMap"));
			map.addControl(new GSmallMapControl());
			map.setCenter(new GLatLng(ido, keido), 17);
			// GClientGeocoderを初期化
			geocoder = new GClientGeocoder();
			// 住所を緯度経度に変換
			//address = adress;
			//showAddress(address);
			
			var iconObj = new GIcon();
			iconObj.image = top_assigned_obj.elements_directory_path + "images/common/tiplogoimg.gif";//"/shop/intro/images/common/tiplogoimg.gif";
			iconObj.iconSize = new GSize(45,55);//32,32
			iconObj.iconAnchor = new GPoint(0,0);
			iconObj.infoWindowAnchor = new GPoint(0,5);
			var marker = new GMarker(new GLatLng(ido, keido),iconObj);
			map.addOverlay(marker);
			
		}
	}
	
	//ie6バグ対応。
	//displayプロパティをnoneの状態でマップの最初の読み込みをしてしまうと、読み込みがストップする
	//位置をずらすことで解消
	//以降のタブ切り替えはdisplayで問題ない
	if( $("#googleMap").size() != 0 )
	{
		$("#googleMap").css( 
		{
			"position": "absolute",
			"top": "-10000px",
			"left": "-10000px"
		});
	}
	
	window.cushion.initTabAccess
	(
		[ 'tabBtn1', 'tabBtn2' ],
		[ 'mapIllust', 'googleMap' ],1
	);
	
	
	/**
	 * 文字サイズの変更部分
	 * 
	 */
	window.cushion.textSizeBtnAction();
	
	
	/**
	 * 各ロールオーバー処理
	 * 
	 */
	//上
	window.cushion.addRollActionById("btnTipness");
	window.cushion.addRollActionById("btnMytipness");
	window.cushion.addRollActionById("btnVisit");
	window.cushion.addRollActionById("btnAdmission");
	window.cushion.addRollActionById("btnGlobalTop");
	window.cushion.addRollActionById("btnGlobalProgram");
	window.cushion.addRollActionById("btnGlobalShop");
	window.cushion.addRollActionById("btnGlobalPlan");
	window.cushion.addRollActionById("btnGlobalAccess");
	
	//中
	//window.cushion.addRollActionById("btnAccessTab001");
	//window.cushion.addRollActionById("btnAccessTab002");
	window.cushion.addRollActionById("btnPrint");
	
	//下
	window.cushion.addRollActionById("btnPagetop");
	window.cushion.addRollActionById("btnProcedure");
	window.cushion.addRollActionById("btnPlayer");
	window.cushion.addRollActionById("btnVisithope");
	window.cushion.addRollActionById("btnMailmagazine");
	window.cushion.addRollActionById("btnFirst");
	window.cushion.addRollActionById("btnFaq");
	
	
	/**
	 *　ポップアップ
	 * 
	 *
	var linkTag = $( "#btnPrintLink" );
	var url = linkTag.attr( "href" );
	linkTag.removeAttr( "href" );
	
	linkTag.click(function(){
		window.open( url, "",  'width=941, height=868, menubar=no, toolbar=no, scrollbars=yes');
	}); */
	
	
	
	
});
})();




