<?php $__env->startSection('css_page_level'); ?>
<link href="<?php echo e(asset('assets/global/plugins/jquery-fancybox/jquery.fancybox.css')); ?>" rel="stylesheet" type="text/css" media="screen"/>
<style type="text/css">
	#myDiv {
		overflow: hidden;
		width: 60%;
		margin: 0px auto;
	}
	#myDiv img {
		height: 200px;
	}
	p{
		font-size: 18px;
		color: inherit;
	}
</style>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('page-content'); ?>
            <div class="wrap-fluid" id="paper-bg">
                <div class="row">
                    <div class="col-lg-12">
                        <div class="box">
                            <div class="box-header">
                                <div class="pull-right box-tools">
                                    <a href="<?php echo e(route('website::spot')); ?>">
                                    <span class="box-btn"><i class="fa fa-times"></i>
                                    </span>
                                    </a>
                                </div>
                                <h3 class="box-title"><i class="fontello-doc"></i>
                                    <span>社區景點-<?php echo e($spot->title); ?></span>
                                </h3>
                            </div>
                            <div class="box-body">
								<div style="font-weight:bold;">
  								    <span style="float:right; font-weight:normal;">編號：<?php echo e($spot->id); ?></span>
 								</div>
                                <hr>
								
						<table class="table table-striped table-bordered" style="width:60%;" align="center">
							<tbody>
								<tr>
									<td>
										<center>
											<?php if($spot->cover_img != ''): ?>
												<img src="<?php echo e($spot->cover_img); ?>" style="padding:3px; background-color:#fff; border:1px solid #d9d9d9;" width="100%" height="90%">
											<?php else: ?>
												<img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff; border:1px solid #d9d9d9;" width="100%" height="90%">
											<?php endif; ?>
										</center>
									</td>
								</tr>
								<?php if($spot->map != ''): ?>
								<tr>
									<td>
										<h4><center><strong>地址：</strong><?php echo e($spot->map); ?></center></h4>
									</td>
								</tr>
								<?php endif; ?>
								<tr>
						
							</tbody>
						</table>
						
									<!--  相簿跑馬燈  -->
										<div id="myDiv" class="panel panel-default">
											<table>
												<tr>
													<td id="pic1">
											<table>
												<tr>
													<td>
														<?php if($spot->image1 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image1); ?>" title=""><img src="<?php echo e($spot->image1); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image1); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($spot->image2 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image2); ?>" title=""><img src="<?php echo e($spot->image2); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image2); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($spot->image3 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image3); ?>" title=""><img src="<?php echo e($spot->image3); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image3); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($spot->image4 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image4); ?>" title=""><img src="<?php echo e($spot->image4); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image4); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
													<td>
														<?php if($spot->image5 != ''): ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image5); ?>" title=""><img src="<?php echo e($spot->image5); ?>" style="padding:3px; background-color:#fff;"></a>
														<?php else: ?>
															<a class="fancybox" rel="gallery1" href="<?php echo e($spot->image5); ?>" title=""><img src="http://placehold.it/320x200" style="padding:3px; background-color:#fff;"></a>
														<?php endif; ?>
													</td>
												</tr>
											</table>
													</td>
													<td id="pic2"></td>
												</tr>
											</table>
										</div>
									<!--  相簿跑馬燈  -->
						
					<table class="table table-striped table-bordered" style="width:60%;" align="center">
							<tbody>
								<tr>
								<?php if($spot->introduce != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>景點介紹：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($spot->introduce); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($spot->safe_note != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>安全事項：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($spot->safe_note); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($spot->file != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>下載附件：</strong></h4>
									</td>
									<td>
										<h4><a href="<?php echo e($spot->file); ?>"><?php echo e($original_filename); ?></a></h4>
									</td>
								</tr>
								<?php endif; ?>
								<?php if($spot->content != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>簡介：</strong></h4>
									</td>
									<td>
										<?=$spot->content;?>
									</td>
								</tr>
								<?php endif; ?>
							</tbody>
						</table>
						
						<table class="table table-striped table-bordered" style="width:60%;" align="center">
							<tbody>
								<?php if($spot->info != ''): ?>
								<tr>
									<td width="20%" style="white-space: nowrap;">
										<h4><strong>交通資訊：</strong></h4>
									</td>
									<td>
										<h4><?php echo e($spot->info); ?></h4>
									</td>
								</tr>
								<?php endif; ?>
								<tr>
									<td colspan="2"><center><div style="border:1px solid #dcdcde; margin-top:10px; width:100%;height:500px;" id="map_canvas"></div></center>
									</td>
								</tr>
								<tr>
									<td colspan="2">
										<h4><strong><center>Google Map</center></strong></h4>
									</td>
								</tr>	
							</tbody>
						</table>
						
                            </div>
                        </div>
                            <div class="btn-group" role="group">
                                <a href="../spot" class="btn btn-primary">回上頁</a>
                            </div>
                    </div>
                </div>
            </div>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('plugins_page_level'); ?>
<script type="text/javascript" src="<?php echo e(asset('assets/global/plugins/jquery-fancybox/jquery.fancybox.pack.js')); ?>"></script>
<?php $__env->stopSection(); ?>

<?php $__env->startSection('js_page_level'); ?>
<script type="text/javascript">
	//變數Speed為設定捲軸的速度用 越小越快
	var Speed=20;
	//接受setInterval所回傳的值
	var timer;
	//取得myDiv的參考用的變數
	var myDiv = document.getElementById("myDiv");
	//取得pic2的參考用的變數
	var pic2= document.getElementById("pic2");
	//讓pic2的innerHTML等於pic1的innerHTML
	pic2.innerHTML=document.getElementById("pic1").innerHTML;
	//用來捲動myDiv捲軸用的主程式
	function picMarquee(){
		//若pic2的寬小於myDiv的scrollLeft，表示捲軸已經過了第一行
		//所以讓Div的scrollLeft再回到原來的位置；反之 則繼續往右跑
		if(pic2.offsetWidth - myDiv.scrollLeft <= 0){
			myDiv.scrollLeft = 0;
		}else{
			myDiv.scrollLeft++;
		}
	}
	//每Speed毫秒就執行一次pciMarquee()
	timer=setInterval(picMarquee,Speed);
	//當滑鼠在myDiv上時 就停止捲動
	myDiv.onmouseover=function(){
		clearInterval(timer);
	}
	//當滑鼠離開myDiv上時 就繼續往右捲動
	myDiv.onmouseout=function(){
		timer=setInterval(picMarquee,Speed);
	}
</script>


</script><script src="http://ditu.google.com/maps?file=api&amp;v=2.x&amp;key=AIzaSyBwO048p23eWOsmHbPU4H0uUEIm2TEXaCU" type="text/javascript"></script>
<script type="text/javascript">
	var cm_baseIcon = new GIcon();
	cm_baseIcon.shadow = "http://www.google.com/mapfiles/shadow50.png";
	cm_baseIcon.iconSize = new GSize(34, 34);
	cm_baseIcon.shadowSize = new GSize(37, 34);
	cm_baseIcon.iconAnchor = new GPoint(9, 34);
	cm_baseIcon.infoWindowAnchor = new GPoint(9, 2);
	cm_baseIcon.infoShadowAnchor = new GPoint(18, 25);
 
    var map = null;
    var geocoder = null;
 
    function initialize() {
      if (GBrowserIsCompatible()) {
        map = new GMap2(document.getElementById("map_canvas"));
		map.setMapType(G_NORMAL_MAP);
    	map.addControl(new GSmallZoomControl());
    	map.addControl(new GMenuMapTypeControl());
		
        map.setCenter(new GLatLng(121.6,24.9), 15);
        geocoder = new GClientGeocoder();
      }
    }
 
    function showAddress(address) {
		var markerOpts = {};
      if (geocoder) {
        geocoder.getLatLng(
          address,
          function(point) {
            if (!point) {
              alert("很抱歉！"+"您輸入的「"+address+"」這個位置無法成功定位！");
            } else {
				/*var nIcon = new GIcon(cm_baseIcon);
				nIcon.image ="images/home.png";
				markerOpts.icon = nIcon;*/
				markerOpts.title=address;
				
              map.setCenter(point);
              var marker = new GMarker(point,markerOpts);
			  marker.openInfoWindowHtml("<strong><?=mb_substr($spot->title,0,8,"utf-8")?>...</strong><br />"+address);
			  GEvent.addListener(marker, "click", function() {
							   marker.openInfoWindowHtml("<strong><?=mb_substr($spot->title,0,8,"utf-8")?></strong>...<br />"+address);
							  });
              map.addOverlay(marker);

              
            }
          }
        );
      }
    }
		window.onload=function(){
		   initialize();
		   showAddress("<?=$spot->map ?>");
		   }

</script>
<?php $__env->stopSection(); ?>


<?php echo $__env->make('layout.front', array_except(get_defined_vars(), array('__data', '__path')))->render(); ?>