﻿// JScript 파일
function preview(){
    self['editer'].tinyMCE.execInstanceCommand('mce_editor_0','mcePreview');
}

function cancel(){
    history.go(-1);
}

function goSubmit(){
    var form = document.getElementById('aspnetForm');
    var post = self['editer'].getText();
    //값체크
    var old_form = new pro_form('aspnetForm');
    if(pro_validator.isEmpty(form.elements['question_category'])){
        alert("카테고리를 선택해 주세요.");
        return;
    }else if(pro_validator.isEmpty(old_form.GetValue('user_name', ""))){
        alert("이름을 입력해 주세요.");
        return;
    }else if(pro_validator.isEmpty(old_form.GetValue('email', ""))){
        alert("이메일을 입력해 주세요.");
        return;
    }else if(pro_validator.isEmpty(old_form.GetValue('contact', ""))){
        alert("연락처을 입력해 주세요.");
        return;
    }else if(pro_validator.isEmpty(old_form.GetValue('title', ""))){
        alert("제목을 입력해 주세요.");
        return;
    }else if(pro_validator.isEmpty(post)){
        alert("내용을 입력해 주세요.");
        return;
    }
    
    form.elements['post'].value = post;
    form.submit();
}

function getInitPost(){
    return document.getElementById("post").value;
}

