<!doctype html>
<!--[if IE 6]><html id="ie6" dir="ltr" lang="zh-TW"><![endif]-->
<!--[if IE 7]><html id="ie7" dir="ltr" lang="zh-TW"><![endif]-->
<!--[if IE 8]><html id="ie8" dir="ltr" lang="zh-TW"><![endif]-->
<!--[if !(IE 6) | !(IE 7) | !(IE 8)  ]><!-->
<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, minimum-scale=1.0, user-scalable=0">
<title><?# webTitle ?></title>	
<meta name="author" content="<?# webTitle ?>" />
<meta name="copyright" content="<?# webName ?>版權所有" />
<meta name="description" content="<?# webDescription ?>" />
<meta name="distribution" content="Taiwan" /> 
<meta name="keywords" content="<?# webKeyword ?>" />
<meta name="format-detection" content="telephone=no" />
<meta property="og:url" content="<?# RelLink ?><?# REQUESTURI ?>" />
<meta property="og:type" content="website" />
<meta property="og:title" content="<?# ogTitle ?>" />
<meta property="og:description" content="<?# ogDescription ?>" />
<meta property="og:image" content="<?# ogImage ?>" />
<link href="/css/<?# webTemplates ?>/main.css" rel="stylesheet">
<link href="/css/<?# webTemplates ?>/layout.css" rel="stylesheet">
<link href="/css/<?# webTemplates ?>/product.css" rel="stylesheet">
<script src="/jquery/jquery-1.10.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="wrapbg"><div id="gradient"></div></div>
<div class="wrapper">
    <?# header ?>
	<?# banner ?>
	<h1 class="pagetitle" data-paroller-factor="-0.1" data-paroller-type="foreground"><b><?# ProductName ?></b></h1>
	<div class="wrap">
		<div class="workframe">
			<div class="waylink">
				<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 id="sideNav" class="catBox">
				<a id="sideMenu" href="javascript:void(0);" title="分類選單"><font>分類選單</font><span><i></i><i></i><i></i></span></a>
				<ul class="Cate">
					<li><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>
			</div>
			<div id="content">
				<div id="products-detail">
                    <div class="sub-pro-img">
                        <div class="imgList">
                            <div><a class="photo" href="<?# IconImage ?>" data-fancybox="gallery" style="background-image:url(<?# IconImage ?>);"><img src="<?# IconImage ?>" alt="<?# ProductName ?>"><img src="/images/30/img-productPhoto.png" alt="<?# ProductName ?>"></a></div>
                            <php:repeater id="listPI">
                            <template>
                            <div><a class="photo" href="<?# Image ?>" data-fancybox="gallery" style="background-image:url(<?# Image ?>);"><img src="<?# Image ?>"><img src="/images/30/img-productPhoto.png"></a></div>
                            </template>
                            </php:repeater>
                        </div>
                    </div>
                    <div class="productInfo">
						<p class="cat"><a href="<?# CategoryLink ?>"><?# CategoryName ?></a></p>
						<p class="txt"<?# NoStyle ?>><label>編號：</label><b><?# ProductNO ?></b></p>
						<h2><?# ProductName ?></h2>
                        <article><?# Introduction ?></article>
                        <div class="price"<?# sellStyle ?>>
                            <p class="txt old"<?# oldPriceStyle ?>><label>原價：</label><b><?# OldPrice ?></b></p>
                            <p class="txt offer"<?# priceStyle ?>><label>特價：</label><b><?# Price ?></b></p>
                        </div>
                        <div class="orderstyleSet">
                            <div class="orderfunction"<?# orderStyle ?>>
								<label>數量：</label>
								<a class="limit" href="javascript:void(0);" data-action="plusBtn" data-type="1">-</a>
								<input type="text" id="q" name="q" value="1">
								<a href="javascript:void(0);" data-action="plusBtn" data-type="2">+</a>
                            </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="like" data-url="<?# RelLink ?><?# REQUESTURI ?>" data-share="true" style="display: none;"></div></li>
							</ul>
							<?# GoogleSearch ?>
						</div>
						<div class="btns">
							<a class="addcar" id="buy" href="javascript:void(0);" title="加入購物車"<?# orderStyle ?>>加入購物車</a>
							<a class="ask" href="<?# askLink ?>" title="諮詢此商品">諮詢此商品</a>
						</div>
                    </div>
                </div>
				<div id="productTabs">
					<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="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="product" class="pagerow">
				<h2 class="titleBox"><font>HOT PRODUCTS</font></h2>
				<div id="otherP" class="pro-list">
					<php:repeater id="listP">
					<template>
					<div>
						<div class="bgBox" style="background-image:url(<?# IconImage ?>);">
							<a class="link" href="<?# link ?>" title="<?# ProductName ?>"></a>
							<img src="/images/30/img-productPhoto.png" alt="<?# ProductName ?>">
							<div class="info">
								<h3 class="text-clamp"><?# ProductName ?></h3>
								<p class="price"<?# sellStyle ?>><span class="old"<?# oldPriceStyle ?>>&#36;<b><?# OldPrice ?></b></span><span<?# priceStyle ?>>&#36;<b><?# Price ?></b></span></p>
								<font class="goTxt">MORE</font>
							</div>
						</div>
					</div>
					</template>
					</php:repeater>
				</div>
			</div>
		</div>
		<div id="otherBox">
			<div id="productcatBox"><div class="workframe"><?# sidePage ?></div></div>
			<div id="conatctBox"><div class="workframe"><?# sidePage2 ?></div></div>
			<?# googlemapBody ?>
		</div>
	</div>
    <?# footer ?>
</div>
</div>
</body>
</html>
<script src="/jquery/30/jquery-layout.js"></script>
<script>
	$(function(){
		$("#products-detail .sub-pro-img .imgList").slick({
			autoplay: true,
			dots: true,
			arrows: false,
			infinite: true,
			speed: 500,
			fade: true,
			cssEase: 'linear'
		});
		
		$('.orderstyleSet .orderfunction a[data-action="plusBtn"]').click(function(){
			var num = $(this).parent('div').children('input').val();
			if($(this).data('type') == '1'){
				num = parseInt(num) - 1;
			}else{
				num = parseInt(num) + 1;
			}
			if(num < 1) num = 1;
			
			$(this).parent('div').children('input').val(num);
		});
		
		$('#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 = '<?# htLink7 ?>';
					}else{
						location.href = location.href;
					}
				},
				error:function(){
					alert('系統異常!請重新整理頁面再試一次!');
					location.href = location.href;
				}
			});
		});
		
		// 預設顯示第一個 Tab
		var _showTab = 0;
		$('#productTabs').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();
			});
		});
	});
	
	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>