<script language="javascript">
function download(boardid,b_idx,idx){
obj = window.open("/module/board/download.php?boardid="+boardid+"&b_idx="+b_idx+"&idx="+idx,"download","width=100,height=100,menubars=0, toolbars=0");
}
<?
//댓글 사용시
if($arrBoardInfo["list"][0]["usememo"]=="Y"){
?>
function checkComment(frm){
	<?if(!$_SESSION[$_SITE["DOMAIN"]]["MEMBER"]["ID"]){?>
	alert("로그인을 하셔야 댓글입력이 가능합니다.");
	return false;
	
	<?}else if($_SESSION[$_SITE["DOMAIN"]]["MEMBER"]["LEVEL"] >= $arrBoardInfo["list"][0]["replylevel"]){?>
	if (frm.comment.value==""){
		alert("댓글 내용을 입력해 주세요.");
		frm.comment.focus();
		return false;
	}
	<?}else{?>

	alert("<?=$arrLevelInfo[$arrBoardInfo["list"][0]["replylevel"]]?> 이상 댓글입력이 가능합니다.");
	return false;
	<?}?>
}
<?
}
//댓글 사용시
?>
</script>
<script type="text/javascript">
function openFileLayer(){
	var fileLayer = document.getElementById("fileLayer");
	if(fileLayer.style.display !='block') {
		fileLayer.style.display = 'block';
	}else{
		fileLayer.style.display = 'none';
	}
	return false
}
</script>
<div class="board-view">
	<div class="head">
		<h3 class="tit"><?=stripslashes($arrBoardArticle["list"][0][subject])?></h3>
		<div class="info">
			<span class="name"><strong><?=$arrBoardArticle["list"][0][name]?></strong></span>
			<span class="date"><?=$arrBoardArticle["list"][0][wdate]?></span>
			<span class="hit"><strong>조회수</strong> <?=number_format($arrBoardArticle["list"][0][hit])?></span>
		</div>
		<div class="files">
			<a href="javascript:;" onclick="openFileLayer();">첨부파일<span class="num">(<strong><?=$arrBoardArticle["total_files"]?></strong>)</span><img src="/images/bbs/file_down.gif" class="ico-down" alt="첨부파일 보기"></a>
			<?if($arrBoardInfo["list"][0]["usepds"] && $arrBoardArticle["total_files"] > 0){?>
			<div class="fileLayer" id="fileLayer">						
				<?for($i=0;$i<$arrBoardArticle["total_files"];$i++){?>
				<a href="javascript:download('<?=$arrBoardArticle["files"][$i][boardid]?>','<?=$arrBoardArticle["files"][$i][b_idx]?>','<?=$arrBoardArticle["files"][$i][idx]?>');" title='<?=$arrBoardArticle["files"][$i][ori_name]?>'><img src="/images/bbs/file_ico.gif" alt="첨부파일"> <?=$arrBoardArticle["files"][$i][ori_name]?></a>
				<?}?>
				<a href="javascript:;" onclick="openFileLayer();" class="divClose"><img src="/images/bbs/file_close.gif" alt="닫기"></a>
			</div>
			<?}?>
		</div>
	</div>
	<div class="body">
		<?=stripslashes($arrBoardArticle["list"][0][contents])?>
	</div>
</div>

<div class="buttons">
	<div class="fr">
		<span class="btn-pack medium"><a href="<?=$_SERVER[DOCUMENT_URI]?>?mNum=<?=$mNum?>&sNum=<?=$sNum?>&boardid=<?=$arrBoardInfo["list"][0]["boardid"]?>&mode=list&sk=<?=$_GET[sk]?>&sw=<?=$_GET[sw]?>&offset=<?=$_GET[offset]?>&category=<?=$_GET[category]?>">목록</a></span>
		<?if($arrBoardInfo["list"][0]["useadminonly"] !="Y" || $_SESSION[$_SITE["DOMAIN"]]["ADMIN"]["ID"]):?>
		<?if($arrBoardInfo["list"][0]["usereply"] =="Y"):?>
		<span class="btn-pack medium"><a href="<?=$_SERVER[DOCUMENT_URI]?>?mNum=<?=$mNum?>&sNum=<?=$sNum?>&boardid=<?=$arrBoardInfo["list"][0]["boardid"]?>&mode=reply&idx=<?=$arrBoardArticle["list"][0][idx]?>&category=<?=$_GET[category]?>">답변</a></span>
		<?endif;?>
		<span class="btn-pack medium"><a href="<?=$_SERVER[DOCUMENT_URI]?>?mNum=<?=$mNum?>&sNum=<?=$sNum?>&boardid=<?=$arrBoardInfo["list"][0]["boardid"]?>&mode=delete&idx=<?=$arrBoardArticle["list"][0][idx]?>&category=<?=$_GET[category]?>">삭제</a></span>
		<span class="btn-pack medium"><a href="<?=$_SERVER[DOCUMENT_URI]?>?mNum=<?=$mNum?>&sNum=<?=$sNum?>&boardid=<?=$arrBoardInfo["list"][0]["boardid"]?>&mode=modify&idx=<?=$arrBoardArticle["list"][0][idx]?>&category=<?=$_GET[category]?>">수정</a></span>
		<?endif;?>
	</div>
</div>

<div class="prev_next">
	<dl class="prev">
		<dt>이전글</dt>
		<dd><?if($arrBoardArticle["prev"]["idx"] !=0):?><a href="<?=$_SERVER[DOCUMENT_URI]?>?mNum=<?=$mNum?>&sNum=<?=$sNum?>&boardid=<?=$arrBoardInfo["list"][0]["boardid"]?>&mode=view&idx=<?=$arrBoardArticle["prev"]["idx"]?>" title="<?=$arrBoardArticle["prev"]["subject"]?>"><?=text_cut($arrBoardArticle["prev"]["subject"],$arrBoardInfo["list"][0][subjectcut])?></a><?else:?>이전글이 없습니다..<?endif;?></dd>
	</dl>
	<dl class="next">
		<dt>다음글</dt>
		<dd><?if($arrBoardArticle["next"]["idx"] !=0):?><a href="<?=$_SERVER[DOCUMENT_URI]?>?mNum=<?=$mNum?>&sNum=<?=$sNum?>&boardid=<?=$arrBoardInfo["list"][0]["boardid"]?>&mode=view&idx=<?=$arrBoardArticle["next"]["idx"]?>" title="<?=$arrBoardArticle["next"]["subject"]?>"><?=text_cut($arrBoardArticle["next"]["subject"],$arrBoardInfo["list"][0][subjectcut])?></a><?else:?>다음글이 없습니다.<?endif;?></dd>
	</dl>
</div>
<!-- 뷰페이지 //-->

<?
//댓글 사용시
if($arrBoardInfo["list"][0]["usememo"]=="Y"){
?>
<!-- 댓글 -->
<div class="comment-area">
	
	<div class="comment-list">
		<ul>
			<?
			if($arrCommentList["total"] > 0){
				for($i=0;$i<$arrCommentList["total"];$i++){
			?>
			<li>
				<div class="info">
					<span class="name"><?=$arrCommentList["list"][$i][user_name]?></span>
					<span class="date"><?=str_replace("-",".",$arrCommentList["list"][$i][wdate])?></span>
				</div>
				<div class="txt">
					<?=stripslashes(nl2br($arrCommentList["list"][$i][comment]))?>
				</div>
				<div class="controll">
					<!-- <a href="#">수정</a>| --><a href="/module/board/board_evn.php?evnMode=comment_delete&idx=<?=$arrCommentList["list"][$i][idx]?>&returnURL=<?=urlencode($_SERVER[REQUEST_URI])?>">삭제</a>
				</div>                                    
			</li>
			<?
				}
			}
			else{
			?>
			<li>등록된 댓글이 없습니다.</li>
			<?}?>
		</ul>
	</div>
	<div class="comment-write">
		<form name="commentFrm" action="/module/board/board_evn.php" method="post" onsubmit="return checkComment(this);">
		<input type="hidden" name="evnMode" value="comment_write">
		<input type="hidden" name="boardid" value="<?=$arrBoardInfo["list"][0][boardid]?>">
		<input type="hidden" name="board_idx" value="<?=$arrBoardArticle["list"][0][idx]?>">
		<input type="hidden" name="returnURL" value="<?=$_SERVER[REQUEST_URI]?>">
			<fieldset>
				<div class="write">
					<div><textarea name="comment" id="c_textarea" cols="80" rows="4" title="댓글입력" class="textarea"/></textarea></div>
					<div class="btn">
						<!-- <span class="byte"><strong>0</strong> &frasl; 300 bytes</span> -->
						<!-- <span class="btn_pack xlarge"><input type="submit" value="등록" /></span> -->
						<div class="btn"><input type="submit" value="등록" class="btn-pack comment"></div>
					</div>
				</div>
			</fieldset>
		</form>
	</div>
</div>
<!-- 댓글 -->
<?
}
//댓글 사용시
?>
