<!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, minimum-scale=1.0, user-scalable=0">
<title><?# webTitle ?></title>
<meta name="keywords" content="<?# webKeyword ?>" />
<meta name="description" content="<?# webDescription ?>" />
<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 ?>" />
<meta name="robots" content="INDEX, FOLLOW" />
<link href="/css/<?# webTemplates ?>/main.css" rel="stylesheet">
<link href="/css/<?# webTemplates ?>/layout.css" rel="stylesheet">
<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 style="margin: 0; padding: 0; border: 0; width: 100%;<?# JumpStyle ?>">
<?# JumpHTML ?>
<?# JumpScript ?>
<link href="/css/pagenav.css" rel="stylesheet">
<link href="/css/<?# webTemplates ?>/product.css" rel="stylesheet">
<div class="wrapper">
    <?# header ?>
    <?# banner ?>
    <div id="content">
    	<section>
            <div class="topnav">
            	<div class="rightside">
                    <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>
					<script>
                    $(function() {
                        $('.catebtn').click(function () {
                            if ('none' == $('#side-nav').css('display') || '' == $('#side-nav').css('display')) {
                                $('#side-nav').fadeIn('fast');
                                $('.catebtn a').html('<i class="fa fa-times-circle-o" aria-hidden="true"></i> 收起選單');
                            } else {
                                $('#side-nav').fadeOut('fast');
                                $('.catebtn a').html('<i class="fa fa-eye" aria-hidden="true"></i> 更多產品');
                                
                            }
                            return false;
                        });
                    });
                    </script>
                    <p class="catebtn"><a><i class="fa fa-eye" aria-hidden="true"></i> 更多產品</a></p>
                    <div id="side-nav">
                        <ul>
                            <li><h3><a href="<?# htLink4 ?>" title="全部產品"><span>→</span>全部產品</a></h3></li>
                            <php:repeater id="listC">
                            <template>
                            <li<?# className ?>>
                                <h3><a href="<?# link ?>" title="<?# CategoryName ?>"><span>→</span><?# CategoryName ?></a><?# iLabel ?></h3>
                                <?# SubList ?>
                            </li>
                            </template>
                            </php:repeater>
                        </ul>
                    </div>
                </div>
                <div class="title"><h1><img src="/images/10/pro-products-title-img.png"><b><?# ProductName ?></b></h1></div>
            </div>
            <div class="content-wrap">
                <div class="content-main">
                    <div class="sub-pro-img">
                        <div>
                            <p style="background-image:url(<?# IconImage ?>);"><a href="<?# IconImage ?>" data-fancybox="gallery"><img alt="<?# ProductName ?>" src="/images/10/index-profile-bg.png"/></a></p>
                        </div>
                        <php:repeater id="listPI">
                            <template>
                                <div>
                                	<p style="background-image:url(<?# Image ?>);"><a href="<?# Image ?>" data-fancybox="gallery"><img alt="<?# ProductName ?>" src="/images/10/index-profile-bg.png"/></a></p>
                                </div>
                            </template>
                        </php:repeater>
                    </div>
                    <div id="products-detail">
                        <div class="pInfo">
                        	<h3><?# ProductName ?></h3>
                            <article><?# Introduction ?></article>
                            <div class="priceStyle payBox"<?# sellStyle ?>>
                                <p <?# oldPriceStyle ?>><span class="money-sale">原價：<?# OldPrice ?></span></p><!-- 原價 -->
                                <p <?# priceStyle ?>><span>特價:<b><?# Price ?></b></span></p><!-- 特價 -->
                            </div>   
                            <div class="payBox" <?# orderStyle ?>>
                                <div class="aday"><p>數量/</p><p class="bi"><b><input type="number" id="q" name="q" value="1" /></b></p></div>
                                <div class="aday add"><p><input type="button" id="buy" name="buy" value="加入購物車" /></p></div>
                                <img src="/images/10/icon-adcars.png" alt="我要購買"/>
                            </div>
                            <p class="contus"<?# askStyle ?>><a href="<?# askLink ?>" title="立即諮詢">立即諮詢 <i class="fa fa-commenting-o"></i></a></p>
                            <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>
                    </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>                        
                    
					<script>
                        $(function(){
                            var _showTab = 0;
                            $('.pro-article').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();
                                });
                            });
                        });
                    </script>
                    <div class="prod-art">
                        <div class="pro-article">
                            <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>
                        <div class="tab_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="products">
                    	<div class="otherTit"><img src="/images/10/pro-oProducts-title-img.png"><b>相關產品</b></div>
                        <div id="bookList">
                            <ul>
                                <php:repeater id="listP">
                                    <template>
                                        <li>
                                            <div class="photo" style="background-image:url(<?# IconImage ?>);">
                                                <a href="<?# link ?>" title="<?# ProductName ?>"><img src="/images/10/index-profile-bg.png" alt="<?# ProductName ?>"></a>
                                            </div>
                                            <div class="info">
                                                <h3><a href="<?# link ?>" title="<?# ProductName ?>"><?# ProductName ?></a></h3>
                                                <p><a href="<?# link ?>" title="<?# Introduction ?>"><?# Introduction ?></a></p>
                                                <p class="more"><a href="<?# link ?>" title="MORE">MORE ></a></p>
                                            </div>
                                        </li>
                                    </template>
                                </php:repeater>
                            </ul>
                        </div>
                    </div>
                </div>
            </div>
    	</section>
    </div>
	<section><?# GoogleSearch ?></section>
    <?# sidePage ?>
    <?# footer ?>
	<script type="text/javascript">
        $(document).ready(function(){
          $('.sub-pro-img').slick({
          slidesToShow: 3,
          slidesToScroll: 1,
          arrows: true,
          autoplay: true,
          autoplaySpeed: 3000,
		  dots:false,
          responsive: [
            {
              breakpoint: 980,
              settings: {
                slidesToShow: 2,
              }
            },
            {
              breakpoint: 640,
              settings: {
                slidesToShow: 1,
              }
            }
          ]
    
        });
		$('#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>      
	<script src="https://d.line-scdn.net/r/web/social-plugin/js/thirdparty/loader.min.js" async defer></script>
</div>
</div>
</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>