if(typeof(QLife)=='undefined'){var QLife={}}QLife.Common.addOnload(function(){QLife.Detail.initTabview();QLife.Detail.updatePagersOnclick();var mapLat=$F('map_lat');var mapLong=$F('map_long');var map=new YahooMapsCtrl('map_mini',mapLat+','+mapLong,1,YMapMode.Map,YDatumType.WGS84);map.setVisibleCentermark(false);map.setEnableWheelOperation(false);map.addCategory('qlife_mappin','/pet/images/icon_mappin.png',{'width':23,'height':25});map.addIcon('hospital',mapLat+','+mapLong,'','qlife_mappin');map.setVisibleSliderbar(false)});QLife.Detail={tabView:null,urlTab0:'',urlTab1:'',urlTab2:'',initTabview:function(){var url=QLife.Common.getUrlSuffix();this.urlTab0=url;this.urlTab1=url+'_map';this.urlTab2=url+'_drqife';this.tabView=new YAHOO.widget.TabView('tabview_container');this.tabView.getTab(0).addListener('click',function(e){QLife.Common.gaTrack(QLife.Detail.urlTab0)});this.tabView.getTab(1).addListener('click',function(e){QLife.Common.gaTrack(QLife.Detail.urlTab1);QLife.Detail.initMap()});var tab3=this.tabView.getTab(2);if(typeof(tab3)!='undefined'){tab3.addListener('click',function(e){QLife.Common.gaTrack(QLife.Detail.urlTab2)})}},updatePagersOnclick:function(){var pagerAnchors=$$('div.pager a');for(var i=0;i<pagerAnchors.length;i++){pagerAnchors[i].onclick=function(){QLife.Detail.updateKuchikomi(this);return false}}},updateKuchikomi:function(anchor){var pathname=QLife.Common.getPathname(anchor);QLife.Common.gaTrack(pathname);$('kuchikomi_list').innerHTML=QLife.Common.IMG_LOADING;new Ajax.Request('hospital_detail_update.php',{method:'get',parameters:{pathname:pathname},onSuccess:function(transport){$('kuchikomi_list').innerHTML=transport.responseText;QLife.Detail.updatePagersOnclick()}})},mapPrinter:null,initMap:function(){if(this.mapPrinter==null){var mapLat=$F('map_lat');var mapLong=$F('map_long');this.mapPrinter=new YahooMapsCtrl('map_printer',mapLat+','+mapLong,3,YMapMode.Map,YDatumType.WGS84);this.mapPrinter.setVisibleCentermark(false);this.mapPrinter.addCategory('qlife_mappin','/pet/images/icon_mappin.png',{'width':23,'height':25});this.mapPrinter.addIcon('hospital',mapLat+','+mapLong,'','qlife_mappin')}},open:function(divId){if($(divId)==null){alert('id='+divId+' is not exist.');return}this.counter=0;this.ev=new PeriodicalExecuter(function(){QLife.Detail._animateOpening(divId)},0.05)},close:function(divId){this.divBg.setStyle({display:'none'});$(divId).setStyle({display:'none'})},divBg:null,counter:0,ev:null,_getPageSize:function(){var width=0,height=0;if(window.innerWidth&&window.scrollMaxX){width=window.innerWidth+window.scrollMaxX;height=window.innerHeight+window.scrollMaxY}else if(document.body.scrollHeight){width=document.body.scrollWidth;height=document.body.scrollHeight}return{width:width,height:height}},_getFormLeft:function(divId){var div=$(divId);var size=QLife.Detail._getPageSize();var left=0;if(size.width-60>div.getWidth()){left=Math.floor((size.width-div.getWidth())/2)}else{left=60}return left},_animateOpening:function(divId){if(this.divBg==null){this.divBg=$(document.createElement('div'));this.divBg.id='toukou_bg';var pageSize=this._getPageSize();this.divBg.setStyle({opacity:'0',position:'absolute',top:'0',left:'0',width:pageSize.width+'px',height:pageSize.height+'px',zIndex:'900'});$$('body')[0].appendChild(this.divBg);window.location='#'+this.divBg.id}var div=$(divId);if(this.counter==0){var left=QLife.Detail._getFormLeft(divId);div.setStyle({opacity:'0',display:'block',top:'100px',left:String(left)+'px'})}else if(this.counter==10){if(this.ev!=null){this.ev.stop();this.ev=null}div.setStyle({opacity:'1'})}else{var opacityStep=1.0/10*this.counter;div.setStyle({opacity:String(opacityStep)})}this.counter++}};
