<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>管理後臺</title>
<meta name="keywords" content="管理後臺" />
<meta name="description" content="管理後臺" />
<script src="/jquery/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="ckfinder/ckfinder.js"></script>
<!-- 瀏覽用燈箱片效果 -->
<link rel="stylesheet" href="/jquery/fancybox/source/jquery.fancybox.css?v=2.1.5" type="text/css" media="screen" />
<script type="text/javascript" src="/jquery/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>
</head>
<body>
	<div class="wrapper">
		<?# header ?>
		<div class="wrap">
			<?# sidePage ?>
			<div class="contentMain">
		    	<h3>Demo圖片設置</h3>
				<div class="article">
					<form id="form1" name="form1" action="webDemoSet.php" method="post">
						<fieldset>
							<div class="titleTyp"><p>Demo圖片設置</p></div>
							<div style=" background: rgba(75, 141, 248, 0.07); padding: 10px 0;">
                                <div class="writList">
                                	<label style="float: left;">首頁Demo圖片</label>
                                    <a id="aImg1" class="fancybox" style="float: left; margin: 0 10px;"><img id="imgImg1" style="width:50px; height:50px; border:0; display:none;" /></a>
                                    <input type="text" id="DemoImage1" name="DemoImage1" value="<?# DemoImage1 ?>" />
                                    <input type="button" id="btnImg1" name="btnImg1" value="瀏覽" />
                                </div>
							</div>
                            
							<div style=" background: rgba(75, 141, 248, 0.07); padding: 10px 0;">
                                <div class="writList">
                                	<label style="float: left;">內頁Demo圖片</label>
                                    <a id="aImg2" class="fancybox" style="float: left; margin: 0 10px;"><img id="imgImg2" style="width:50px; height:50px; border:0; display:none;" /></a>
                                    <input type="text" id="DemoImage2" name="DemoImage2" value="<?# DemoImage2 ?>" />
                                    <input type="button" id="btnImg2" name="btnImg2" value="瀏覽" />
                                </div>
							</div>
                            <p>
								<input type="button" id="btnOK" name="btnOK" value="確 定" />
							</p>
						</fieldset>
					</form>
				</div>
			</div>
		</div>
		<?# footer ?>
	</div>
<script>
<!--
	function SetFileField(fileUrl,data){
		$('#'+data["selectActionData"]).val(fileUrl);
		$('#'+data["selectActionData"]).change();
	}
	$(function(){
		$(".fancybox").fancybox();

		$('#DemoImage1').change(function(){
			if($(this).val() == ''){
				$('#imgImg1').attr('src','');
				$('#imgImg1').css('display','none');
				$('#aImg1').attr('href','');
			}else{
				$('#imgImg1').attr('src',$(this).val());
				$('#imgImg1').css('display','block');
				$('#aImg1').attr('href',$(this).val());
			}
		});
		$('#DemoImage1').change();

		$('#btnImg1').click(function(){
			var finder = new CKFinder();
			finder.basePath = 'ckfinder/';
			finder.resourceType = 'Images';
			finder.selectActionFunction = SetFileField;
			finder.selectActionData = 'DemoImage1';
			finder.popup();
		});

		$('#DemoImage2').change(function(){
			if($(this).val() == ''){
				$('#imgImg2').attr('src','');
				$('#imgImg2').css('display','none');
				$('#aImg2').attr('href','');
			}else{
				$('#imgImg2').attr('src',$(this).val());
				$('#imgImg2').css('display','block');
				$('#aImg2').attr('href',$(this).val());
			}
		});
		$('#DemoImage2').change();

		$('#btnImg2').click(function(){
			var finder = new CKFinder();
			finder.basePath = 'ckfinder/';
			finder.resourceType = 'Images';
			finder.selectActionFunction = SetFileField;
			finder.selectActionData = 'DemoImage2';
			finder.popup();
		});

		$('#btnOK').click(function(){
			$('#form1').submit();
		});
	});
//-->
</script>
</body>
</html>