<!doctype html>
<!--[if IE 8 ]><html dir="ltr" lang="zh-TW" class="ie8"><![endif]-->
<!--[if IE 9 ]><html dir="ltr" lang="zh-TW" class="ie9"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html dir="ltr" lang="zh-TW">
<!--<![endif]-->
<head>
<!--[if lt IE 9]>
<script src="/js/html5.js"></script>
<![endif]-->
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0" />
<title><?# webTitle ?></title>
<meta name="keywords" content="<?# webKeyword ?>" />
<meta name="description" content="<?# webDescription ?>" />
<meta property="og:title" content="<?# webTitle ?>"/>
<meta property="og:type" content="<?# webDescription ?>"/>
<meta property="og:url" content="<?# HTTPHOST ?><?# REQUESTURI ?>"/>
<meta property="og:image" content="<?# HTTPHOST ?><?# logoImage ?>"/>
<link rel="index" title="<?# webTitle ?>" href="<?# RelLink ?>/index.html" />
<link rel="sitemap" type="htm" title="<?# webTitle ?>" href="<?# RelLink ?>/sitemap.xml" />
<link rel="alternate" type="application/rss+xml" href="<?# RelLink ?>/rss.xml" title="<?# webKeyword ?>" />
<link href="/css/animate.css" rel="stylesheet">
<link href="/css/font-awesome.min.css" rel="stylesheet">
<link rel="stylesheet" href="/css/<?# webTemplates ?>/normalize.css">
<link rel="stylesheet" href="/css/<?# webTemplates ?>/main.css">
<link rel="stylesheet" href="/css/<?# webTemplates ?>/layout.css">
<link rel="stylesheet" href="/css/<?# webTemplates ?>/product.css">
<script src="/jquery/jquery-1.10.js"></script>
<link  href="/jquery/fancybox-3.0/dist/jquery.fancybox.css" rel="stylesheet"></script>
<script src="/jquery/fancybox-3.0/dist/jquery.fancybox.min.js"></script>
<script>
	if('<?# alertMsg ?>' != ''){
		alert('<?# alertMsg ?>');
		if('<?# goBack ?>' == 'Y'){
			history.back();
		}
	}
	if('<?# locationHref ?>' != ''){
		location.href = '<?# locationHref ?>';
	}
</script>
<?# headHTML ?>
</head>
<body<?# JumpBody ?>>
<?# bodyTopHTML ?>
<div class="webBox" style="margin: 0; padding: 0; border: 0; width: 100%;<?# JumpStyle ?>">
<?# JumpHTML ?>
<?# JumpScript ?>
<div class="wrapper">
    <?# header ?>
    <?# banner ?>
	<div class="waylink">
		<div class="workframe">
			<ol>
				<li><a title="首頁" href="/">首頁</a></li>
				<li><a href="<?# htLink4 ?>" title="產品">產品</a></li>
				<php:repeater id="listR">
				<template>
				<li><a href="<?# Link ?>" title="<?# Name ?>"><?# Name ?></a></li>
				</template>
				</php:repeater>
				<li><?# ProductName ?></li>
			</ol>
		</div>
	</div>
    <div class="wrap">
   		<div class="content-wrapper">
   			<div class="workframe">
   				<div id="content">
					<div id="articleBox">
						<h1 class="pagetitle"><?# ProductName ?></h1>
						<div id="products-detail">
							<div class="sub-pro-img">
								<div>
									<div><p style="background-image:url(<?# IconImage ?>);"><a href="<?# IconImage ?>" data-fancybox="gallery"><img src="/images/25/img-productBg.png" alt="<?# ProductName ?>"></a></p></div>
									<php:repeater id="listPI">
									<template>
									<div><p style="background-image:url(<?# Image ?>);"><a href="<?# Image ?>" data-fancybox="gallery"><img src="/images/25/img-productBg.png"></a></p></div>
									</template>
									</php:repeater>
								</div>
							</div>
							<div class="productInfo">
								<span class="cat"><?# CategoryName ?></span>
								<h2><?# ProductName ?></h2>
								<p class="ProductNO"<?# NoStyle ?>><font>編號：</font><?# ProductNO ?></p>
								<article><?# Introduction ?></article>
								<div class="price"<?# sellStyle ?>>
									<p class="old" <?# oldPriceStyle ?>><font>原價：</font><?# OldPrice ?></p>
									<p <?# priceStyle ?>><font>特價：</font><b><?# Price ?></b></p>
								</div>
								<div class="orderstyleSet">
									<div class="orderfunction"<?# orderStyle ?>>
										<div class="aday"><font>數量：</font><input type="number" id="q" name="q" value="1" /></b></p></div>
										<div class="aday add"><a class="more" id="buy" href="javascript:void(0);" title="加入購物車"><span>加入購物車</span><i class="fa fa-shopping-basket"></i></a></div>
									</div>
									<div class="ask"<?# askStyle ?>><a class="more" href="<?# askLink ?>" title="諮詢此商品"><span>諮詢此商品</span><i class="fa fa-commenting-o"></i></a></div>
								</div>
							</div>
                            <div id="pagenav">
                                <p class="page-prev" <?# pageUpStyle ?>><a href="<?# pageUpLink ?>"><b><i class="fa fa-chevron-circle-left"></i>上一個</b>&nbsp;<?# pageUpName ?></a></p>
                                <p class="page-next" <?# pageDownStyle ?>><a href="<?# pageDownLink ?>"><?# pageDownName ?>&nbsp;<b>下一個<i class="fa fa-chevron-circle-right"></i></b></a></p>
                            </div>                        
						</div>
						<div id="productTab">
							<ul class="tabs">
								<php:repeater id="listT">
								<template>
								<li><a href="#tab<?# NO ?>"><?# Title ?></a></li>
								</template>
								</php:repeater>
								<li<?# SpStyle ?>><a href="#tabSp">規格</a></li>
							</ul>
							<div id="tabs_container">
								<php:repeater id="listD">
								<template>
								<div id="tab<?# NO ?>" class="tab_content"><?# Description ?></div>
								</template>
								</php:repeater>
								<div id="tabSp" class="tab_content"<?# SpStyle ?>><?# Specification ?></div>
							</div>
						</div>
						<div id="community">
							<ul>
								<li class="fbb"><div class="fb-like" data-href="<?# RelLink ?><?# REQUESTURI ?>" data-layout="button_count" data-action="like" data-size="small" data-show-faces="true" data-share="true"></div></li>
								<li><a href="https://twitter.com/share" class="twitter-share-button" data-lang="zh-tw" data-dnt="true">推文</a><script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script></li>
                                <li><div class="line-it-button" data-lang="zh_Hant" data-type="share-b" data-url="<?# RelLink ?><?# REQUESTURI ?>" style="display: none;"></div></li>
							</ul>
						</div>
						<div id="other-product">
                        	<div class="entitle"><h2>HOT PRODUCTS</h2></div>
                            <div id="prolay">
                            	<ul class="productList">
									<php:repeater id="listP">
									<template>
									<li>
				                    	<a class="photo" href="<?# link ?>" style="background-image:url(<?# IconImage ?>);" title="<?# ProductName ?>"><i class="fa fa-search-plus"></i>
				                    		<div class="protitle">
				                    			<p><?# ProductName ?></p>
					                    		<p class="price"<?# sellStyle ?>><span class="old"<?# oldPriceStyle ?>>原價<b><?# OldPrice ?></b>元</span><span<?# priceStyle ?>>特價<b><?# Price ?></b>元</span></p>
				                    		</div>
				                    		<img src="/images/25/book-blank.png" border="0" alt="<?# ProductName ?>" />
					                    </a>
					                </li>
									</template>
									</php:repeater>
								</ul>
                        	</div>
                        </div>
					</div>
					<div id="sideNav">
						<h2 class="sideTitle">Products <b><?# CategoryName ?></b><i class="fa fa-chevron-down"></i></h2>
						<div class="mobnav">
							<ul class="Cate">
								<li<?# categoryClass ?>><h3><a href="<?# htLink4 ?>" title="全部產品">全部產品</a></h3></li>
								<php:repeater id="listC">
								<template>
								<li<?# className ?>>
									<h3><a href="<?# link ?>" title="<?# CategoryName ?>"><?# CategoryName ?></a><?# iLabel ?></h3>
									<?# SubList ?>
								</li>
								</template>
								</php:repeater>
							</ul>
							<?# sidePage ?>
							<?# GoogleSearch ?>
						</div>
						<?# sidePage2 ?>
					</div>
           		</div>
            </div>
		</div>
    </div>
    <?# footer ?>
</div>
</div>
<script src="https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js" async defer></script>
<script src="/jquery/main-jquery.js"></script>
<script>
	$(function(){
		$('.sub-pro-img >div').slick({
			slidesToShow: 1,
			slidesToScroll: 1,
			autoplay: false,
			autoplaySpeed: 2000,
			dots: false,
			arrows: true
		});
		// 預設顯示第一個 Tab
		var _showTab = 0;
		$('#productTab').each(function(){
			var $tab = $(this);
			var $defaultLi = $('ul.tabs li', $tab).eq(_showTab).addClass('active');
			$($defaultLi.find('a').attr('href')).siblings().hide();
			$('ul.tabs li', $tab).click(function() {
				var $this = $(this),
				_clickTab = $this.find('a').attr('href');
				$this.addClass('active').siblings('.active').removeClass('active');
				$(_clickTab).stop(false, true).fadeIn().siblings().hide();
				return false;
			}).find('a').focus(function(){
				this.blur();
			});
		});
		$('#buy').click(function(){
			var re = /^[0-9]+$/;
			if(!re.test($('#q').val()) || $('#q').val() == "0"){
				alert("購買數量只能輸入大於0的阿拉伯數字!!");
				$('#q').focus();
				return false;
			}
			$.ajax({
				url: 'ajax/cart.php',
				async: false,
				type: 'POST',
				data: {'do':'add','id':'<?# ProductID ?>','q':$('#q').val()},
				dataType: 'json',
				success: function(JData){
					alert(JData["msg"]);
					if(JData["err"] == "0"){
						location.href = 'order.html';
					}else{
						location.href = location.href;
					}
				},
				error:function(){
					alert('系統異常!請重新整理頁面再試一次!');
					location.href = location.href;
				}
			});
		});
	});
</script>
</body>
</html>
<script>
    $(document).ready(function(){
        $("[data-fancybox]").fancybox({
          youtube : { controls : 0,showinfo : 0 },
          vimeo : { color : 'f00' }
        });             
    }); 
</script>
<script>
	document.body.oncopy = event => {
		event.preventDefault();
		let textFont,
		copyFont = window.getSelection(0).toString();
		if(copyFont.length > 10){
			textFont = copyFont + '\n\n' + '原文網址: <?# webTitle ?> <?# RelLink ?><?# REQUESTURI ?>\n' + '著作權歸作者所有。商業轉載請聯絡作者獲得授權，非商業轉載請註明出處。';
		}else{
			textFont = copyFont;
		}
		if(event.clipboardData){
			return event.clipboardData.setData('text', textFont);
		}else{// 相容IE
			return window.clipboardData.setData('text', textFont);
		}
	};
</script>