$(function(){
$("#btn_comment_write").click(function(){
//alert("Ad");
if(!$("#commnet_user_id").val()){
alert("로그인해주시기 바랍니다.");
}else if(!$("#comment_user_contents").val()){
alert("내용을 입력해주세요.");
}else{
$("#comment_user_spamfree").val(1725756479);
$("#userCommentFrm").submit();
}
});
});
function gotob(mode, uid){
$("#boardForm #mode").val(mode);
$("#boardForm #UID").val(uid);
$("#boardForm").submit();
}
var board_bid = "board02";
var board_gid = "root";
var board_skin_type = "n_default";
var board_uid = "
Warning: Undefined array key "UID" in /mdtool/www/js/wizboardjs.php on line 28
";
function board_write_fnc(f){
if($("#sethtmleditor").val() == "1") oEditors.getById["CONTENTS"].exec("UPDATE_IR_FIELD", []); //smart Editor 에 대한 보강
if(f.spamfree.value){
alert('데이타가 전송중입니다.');
return false;
}else if(autoCheckForm(f)){
//첨부된 파일 정보를 바꾼다.
if(f.multi_file_list != undefined){
var multi_file_len = f.multi_file_list.length;
var TmpMultiFileValue = '';
var tmparr = "";
for(var i=0; i< multi_file_len; i++){
if(f.multi_file_list.options[i]) TmpMultiFileValue += f.multi_file_list.options[i].value + '|';
}
f.MultiFileValue.value = TmpMultiFileValue;
}
f.spamfree.value='1725756479';
$("#WRITE_FORM_TRANSFER_DIV").show();
$("#WRITE_FORM_DIV").hide();
return true;
}else return false;
}
function comment_write_fnc(f){
if(f.spamfree.value){
alert('데이타가 전송중입니다.\n그대로 기다리시거나 새로고침을 하여 주시기 바랍니다.');
return false;
}else if(f.ismember.value == "true" && f.ID.value == ""){
alert('회원전용입니다.\n로그인후 이용해주세요');
return false;
}else if(autoCheckForm(f)){
f.spamfree.value='1725756479';
return true;
}else return false;
}
function tb_box(v){//트랙백관련 박스 숨기고 보이게 하기
if(v.checked) tb_url_box.style.display = "block";
else tb_url_box.style.display = "none";
}
function DELETE_THIS(UID,cp,BID,GID,adminmode,optionmode){
window.open("./wizboard/delete.php?UID="+UID+"&cp="+cp+"&BID="+BID+"&GID="+GID+"&adminmode="+adminmode+"&optionmode="+optionmode,"","scrollbars=no, toolbar=no, width=340, height=150, top=220, left=350")
}
function down(updir, uid){
file_url = "./wizboard/download.php?filename="+updir+"&UID="+uid+"&BID="+board_bid+"&GID="+board_gid;
location.href=file_url;
}
function printThis(){
window.open('./wizboard/skin/n_default/print.php?UID=&BID=board02&GID=root','printer','resizable=yes,width=630,height=650');
}
function sendmail(bid,uid){
file_url = "./wizboard/sendemail.php?UID="+uid+"&BID=board02&GID=root";
window.open(file_url,'printer','resizable=yes,width=400,height=460');
}
function closeImgLayer(){
imgLayer.style.display = "none";
}
function openImgLayer(src){
imgLayer.style.posLeft = event.clientX
imgLayer.style.posTop = event.clientY
imgLayer.style.display = "block";
popLayerImg.src = src;
}
function repleMod(uid){//리플정보를 불러와 수정모드로 변경한다.
$.post("./lib/ajax.board.php", {smode:"getreple",bid:"board02",gid:"root", uid:uid}, function (data){
var result=data.split("|");
if(document.getElementById("RPLCONTENTS")) document.getElementById("RPLCONTENTS").value = result[1];
document.COMMENT.REPLE_MODE.value="update";
document.COMMENT.RUID.value=uid;
});
}
function orderby(v){
var f = document.board_search;
f.oderflag.value = v.value;
f.submit();
}
// gamech 용 시작
function orderby1(v){
var f = document.board_search;
f.oderflag.value = v.value;
if(v.value == "GETPOINT@desc" || v.value == "RECCOUNT@desc" || v.value == "RPLCOUNT@desc" || v.value == "COUNT@desc" )
{
f.search_term.value = 60*60*24*30*3;
}
else
{
f.search_term.value = "";
}
f.submit();
}
function lv_select(lv){
location.href="./wizboard.php?BID=board02&GID=root&SEARCHTITLE=GETPOINT&optionmode="+lv;
}
// gamech 용 끝
function boardSearch(f, type){
if(type == undefined) type = "";
switch(type)
{
case 1:
//검색필드가 책크박스로서 멀티 구현시
// 이경우는 으로 처리 되어 있어야함
var cnt = 0;
var stitle = "";
var currEl;
for(i = 0; i < f.elements.length; i++)
{
currEl = f.elements[i];
if(currEl.type != undefined){
if(currEl.type.toLowerCase() == "checkbox" && currEl.checked == true){
stitle += currEl.value + "+";
cnt++;
}
}
}
if (cnt == 0)
{
alert('한개이상의 검색필드를 선택해 주세요');
return false;
}
else
{
f.SEARCHTITLE.value = stitle;
return true;
}
break;
default:
if(autoCheckForm(f))
{
return true;
}
else
{
return false;
}
break;
}
}
function ShowPopLayer(aEvent,LayName)
{
// 사용법 ShowPopLayer(event,'레이어 ID')"
var x = window.event ? window.event.clientX + document.documentElement.scrollLeft : aEvent.pageX;
var y = window.event ? window.event.clientY + document.documentElement.scrollTop : aEvent.pageY;
if (LayName) document.getElementById(LayName).style.top=y+"px";
if (LayName) document.getElementById(LayName).style.left=x+"px";
if (LayName) document.getElementById(LayName).style.display="block";
}
//community 스킨용
function add_file()
{
if(document.BOARD_WRITE_FORM["multi_file_list"].length == 10)
{
window.alert("파일은 10개 만 첨부가능 합니다.");
return false;
}
var ref = "./wizboard/fileprocess_editor.php?bid=board02&gid=root";
newWindow = window.open(ref,"add_files",'width=312, height=157,left=300,top=250, toolbar=no, location=no, directories=no, status=no, menubar=no, resizable=no, scrollbars=no, copyhistory=no');
}
function del_file()
{
var file_name = "";
var file_ok = 0;
var obj = document.BOARD_WRITE_FORM["multi_file_list"];
for(i=0;i= 0 ; i--)
{
text_a[i] = obj.options[i].text;
value_a[i] = obj.options[i].value;
if(obj.options[i].selected)
{
if(i == obj.length-1)
{
window.alert(obj.options[i].text+" 파일을 내릴수 없습니다.");
obj.options[i].selected = false;
return false;
}
var checkidx = i+1;
text = obj.options[i].text;
value = obj.options[i].value;
text_a[i] = obj.options[i+1].text;
value_a[i] = obj.options[i+1].value;
text_a[i+1] = text;
value_a[i+1] = value;
file_ok++;
}
}
if(file_ok==0)
{
window.alert("파일을 선택하세요.");
return false;
}
for(i=0 ; i < obj.length ; i++)
{
var up_option = new Option(text_a[i],value_a[i]);
obj.options[i] = up_option;
}
obj.options[checkidx].selected = true;
return true;
}
//ajax 관련 시작
//투표시작
function Vote(uid,flag)
{
//flag : g : Good, b : Bad
//Vote('uid','g')
if(flag == 'g') var Ctext = '추천';
else var Ctext = '비추천';
if(confirm('해당글을 ' + Ctext + ' 하시겠습니까?'))
{
xmlHttpPost('./lib/ajax.vote.php', 'uid='+uid+'&flag='+flag+'&gid=root&bid=board02', 'ch_replecnt');
}
}
function ch_replecnt(pdata)
{
eval(pdata);
var result = result;
var msg = msg;
var targetDiv = targetDiv;
if(result == false){
alert(msg);
}else{
if(targetDiv != undefined){
var str = document.getElementById(targetDiv);
str.innerHTML = parseInt(str.innerHTML) + 1;
}
}
}
//리플에서의 투표시작
function voteReple(uid,flag)
{
//voteReple('','ajax_replevote.php','g')
if(flag == 'g') var Ctext = '추천';
else var Ctext = '비추천';
if(confirm('해당글을 ' + Ctext + ' 하시겠습니까?'))
{
xmlHttpPost('./lib/ajax.replevote.php', 'uid='+uid+'&flag='+flag+'&gid=root&bid=board02', 'ch_replecnt1');
}
}
function ch_replecnt1(pdata)
{
// targtDiv = g_vote(추천) or b_vote(비추천)
eval(pdata);
var result = result;
var msg = msg;
var targetDiv = targetDiv;
if(result == false){
alert(msg);
}else{
var str = document.getElementById(targetDiv);
str.innerHTML = parseInt(str.innerHTML) + 1;
}
}
//리스트 가져오기(대박/추천 게시물)
function GetList(spage, listno, flag,targetDiv)
{
//flag = lv30 : 대박 게시물, rec : 추천게시물
// document.getElementById("msgstr").innerHTML = 'spage='+spage+'&listno='+listno+'&flag='+flag+'&targetDiv='+targetDiv+'&gid=root&bid=board02';
xmlHttpPost('./lib/ajax.getlist1.php', 'spage='+spage+'&listno='+listno+'&flag='+flag+'&targetDiv='+targetDiv+'&gid=root&bid=board02', 'DisplayList');
}
function DisplayList(pdata)
{
eval(pdata);
var arData = a;
var NeedDiv = NeedDiv;
var str = document.getElementById(NeedDiv);
while(str.childNodes.length)
{
str.removeChild(str.childNodes[0]);
}
for (var i=0; i