<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">
		<?if($arrBoardInfo["list"][0]["usepds"] && $arrBoardArticle["total_files"] > 0):?>
		<?
		for($i=0;$i<$arrBoardArticle["total_files"];$i++){
			switch($arrBoardArticle["files"][$i][type]){
			case("video/x-ms-asf"):
			case("video/x-ms-wm"):
			case("video/x-ms-wmv"):
			case("video/x-ms-wmx"):
			case("video/x-ms-wvx"):
			case("video/x-msvideo"):
			//비디오 포맷시 미디어 플레이어 나옴
			?>
			<div id="file<?=$i?>" align=center>
			  <OBJECT ID="oMediaPlayer" CLASSID="CLSID:6BF52A52-394A-11d3-B153-00C04F79FAA6" codebase="http://activex.microsoft.com/activex/controls/mplayer/en/nsmp2inf.cab#Version=5,1,52,701" width="400" height="364"  name="oMediaPlayer" VIEWASTEXT>
			  <PARAM name="url" value="/uploaded/board/<?=$boardid?>/<?=$arrBoardArticle["files"][$i][re_name]?>"/>
			  <PARAM NAME="transparentAtStart" VALUE="True">
			  <PARAM NAME="transparentAtStop" VALUE="True">
			  <PARAM NAME="AnimationAtStart" VALUE="False">
			  <PARAM NAME="AutoStart" VALUE="True">
			  <PARAM NAME="AutoRewind" VALUE="False">
			  <PARAM NAME="SendMouseClickEvents" VALUE="True">
			  <PARAM NAME="DisplaySize" VALUE="0">
			  <PARAM NAME="AutoSize" VALUE="False">
			  <PARAM NAME="ShowDisplay" VALUE="False">
			  <PARAM NAME="ShowStatusBar" VALUE="False">
			  <PARAM NAME="ShowControls" VALUE="False">
			  <PARAM NAME="ShowTracker" VALUE="False">
			  <PARAM NAME="Enabled" VALUE="1">
			  <PARAM NAME="EnableContextMenu" VALUE="0">
			  <PARAM NAME="EnablePositionControls" VALUE="0">
			  <PARAM NAME="EnableFullScreenControls" VALUE="0">
			  <PARAM NAME="ShowPositionControls" VALUE="0">
			  <PARAM NAME="Mute" VALUE="0">
			  <PARAM NAME="Rate" VALUE="1">
			  </OBJECT>
			</div>

			<?
			break;
			//비디오 포맷시 미디어 플레이어 종료


			case("application/x-shockwave-flash"):
			//플래쉬 포맷시 미디어 플레이어 나옴
			$size = GetImageSize($_SITE["BOARD_DATA"] . "/".$boardid."/".$arrBoardArticle["files"][$i][re_name]);
			if($size[0] > $size[1]){
				if($size[0] > 740){
					$f_width = 740;
					$f_height = ($size[1] / $size[0]) * $f_width;
				}else{
					$f_width = $size[0];
					$f_height = $size[1];
				}
			}else{
				if($size[1] > 1000){
					$f_height = 1000;
					$f_width = ($size[0] / $size[1]) * $f_height;
				}else{
					$f_height = $size[1];
					$f_width = $size[0];
				}
			}
			?>
			<div id="file<?=$i?>" align=center>
			  <object classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=4,0,2,0' width='<?=$f_width?>' height='<?=$f_height?>'>
			  <param name=movie value='/uploaded/board/<?=$boardid?>/<?=$arrBoardArticle["files"][$i][re_name]?>'>
			  <param name=quality value=high>
			  <param name=BGCOLOR value=''>
			  <param name='SCALE' value='exactfit'>
			  <embed src='/uploaded/board/<?=$boardid?>/<?=$arrBoardArticle["files"][$i][re_name]?>' quality=high pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash' scale='exactfit' bgcolor=''  width='<?=$f_width?>' height='<?=$f_height?>'>
			  </embed>
			  </object>
			</div>
			<?
			break;
			//플래쉬 포맷시 미디어 플레이어 종료

			//이미지 포맷시 이미지 보여줌
			case("image/pjpeg"):
			case("image/jpeg"):
			case("image/x-png"):
			case("image/png"):
			case("image/gif"):
			$size = GetImageSize($_SITE["BOARD_DATA"] . "/".$boardid."/".$arrBoardArticle["files"][$i][re_name]);
			if($size[0] > $size[1]){
				if($size[0] > 740){
					$f_width = 740;
					$f_height = ($size[1] / $size[0]) * $f_width;
				}
				else{
					$f_width = $size[0];
					$f_height = $size[1];
				}
			}else{
				if($size[1] > 1000){
					$f_height = 1000;
					$f_width = ($size[0] / $size[1]) * $f_height;
				}else{
					$f_height = $size[1];
					$f_width = $size[0];
				}
			}
			?>
			<div id="file<?=$i?>" align=center>
			  <a href="javascript:download('<?=$arrBoardArticle["files"][$i][boardid]?>','<?=$arrBoardArticle["files"][$i][b_idx]?>','<?=$arrBoardArticle["files"][$i][idx]?>');"><img src="/uploaded/board/<?=$boardid?>/<?=$arrBoardArticle["files"][$i][re_name]?>" width="<?=$f_width?>" height="<?=$f_height?>" border="0"></a>
			</div>
			<?

			break;
			default:
			break;
			?>

			<?
			}
		}
		?>
		<?endif;?>
		<?=stripslashes($arrBoardArticle["list"][0][contents])?>
	</div>
</div>

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