var IE = false ;
if (window.navigator.appName.indexOf("Explorer") !=-1)
{
    IE = true;
}

function resizeIFrame( iframeName  ) {
        var ParentFrame     =   null;
        if(IE){
            ParentFrame = eval ( iframeName +".document.body" ) ;
        }else{
            ParentFrame = document.getElementById(iframeName).contentDocument.body;
        }
        //var ContentFrame  =   document.all["papermain"];
        var ContentFrame    =   document.getElementById(iframeName) ;
        //ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight) + 100;
        ContentFrame.style.height = ParentFrame.scrollHeight + (ParentFrame.offsetHeight - ParentFrame.clientHeight)  ;
        //ContentFrame.style.width = ParentFrame.scrollWidth + (ParentFrame.offsetWidth - ParentFrame.clientWidth);


}
function reloadIFrame(iframeName , url ) {
    var ContentFrame    =   document.getElementById(iframeName) ;
    ContentFrame.src = url ;
}
function clearForm( formName) {
    form = eval ( "document." + formName ) ;
    var first = true;
    var catMsg = "";
    var curMsg;
    for(i=0; i< form.length; i++){
        if(form.elements[i].type != "button"
            && form.elements[i].type != "reset"
            && form.elements[i].type != "submit")
        {
            if(form.elements[i].type == "checkbox"
                || form.elements[i].type == "radio"){
                if(form.elements[i].checked){
                    // ÆûÀÇ ³»¿ëÀ» ÃÊ±âÈ­ ÇÏÁö ¾Ê´Â´Ù.
                        form.elements[i].checked = false;
                }else{
                        continue;
                }
            }else if(form.elements[i].type == "select-one"){
                var index = form.elements[i].selectedIndex;
                if(form.elements[i].options[index].value != ""  ){
                }
                else
                {
                }
                // '' °ªÀ» ³Ñ°ÜÁÖ±â À§ÇØ ¸¸¾à __NULL__ÀÌ¸é currMsg ¸¦ '' ·Î ¹Ù²Û´Ù.
                if (form.elements[i].options[index].value == '__NULL__' ) {
                        curMsg = '' ;
                        form.elements[i].options[index].value = curMsg;
                }
                    // ÆûÀÇ ³»¿ëÀ» ÃÊ±âÈ­ ÇÏÁö ¾Ê´Â´Ù.
                form.elements[i].selectedIndex = 0;
            } else
            {
                    form.elements[i].value  = "";
            }
            if(first){
                first = false;
            }else{
            }
        }
    }
}

function setFormValue( fieldName , VALS ) {
    var field = eval ( fieldName + ".value") ;
    field =  VALS ;
}

function xbbs_list() {
    var theForm = document.xbbsform ;
    theForm.action="index.jsp" ;
	theForm.menu.value = "list" ; 
    theForm.submit() ;
}
function xbbs_list_admin() {
    var theForm = document.xbbsform ;
    theForm.action="/adm/news/index.jsp" ;
	theForm.menu.value = "list" ; 
    theForm.submit() ;
}
function xbbs_write() {
    var theForm = document.xbbsform ;
    theForm.action="index.jsp" ;
	theForm.menu.value = "write" ; 
    theForm.submit() ;

}
function xbbs_delete() {
    if ( confirm('Are you sure?') ) {
    var theForm = document.xbbsform ;
    theForm.action="index.jsp" ;
	theForm.menu.value = "delete" ; 
    theForm.submit() ;
    }
}
function xbbs_edit() {
    if ( confirm('Are you sure?') ) {
    var theForm = document.xbbsform ;
    theForm.action="index.jsp" ;
	theForm.menu.value = "edit" ; 
    theForm.submit() ;
    }
}
function xbbs_go(page) {
    var theForm = document.xbbsform ;
    theForm.pnum.value= page ;
    theForm.submit() ;
}
function xbbs_read(serial) {
    var theForm = document.xbbsform ;
    theForm.action="index.jsp" ;
	theForm.menu.value = "read" ; 
    theForm.SEQ.value = serial ;
    theForm.submit() ;
}
function xbbs_reply() {
/*
    var theForm = document.xbbsform ;
    theForm.action="/admin/common/reply_submit.jsp" ;
    theForm.submit() ;
	*/
}

function xbbs_submit() {
//alert("") ;
    var theForm = document.xbbsform ;
    theForm.method="post" ;
    //theForm.action="index.jsp" ;
    theForm.action="/news/write_submit.jsp" ;
    theForm.enctype="multipart/form-data" ;
	//theForm.menu.value = "write_submit" ; 
    theForm.submit() ;
}
function xbbs_submit_newsletter() {
//alert("") ;
    var theForm = document.xbbsform ;
    theForm.method="post" ;
    //theForm.action="index.jsp" ;
    theForm.action="/news/write_submit.jsp" ;
    theForm.enctype="multipart/form-data" ;
	//theForm.menu.value = "write_submit" ; 
    theForm.submit() ;
}
function xbbs_reset() {
    var theForm = document.xbbsform ;
	theForm.reset() ; 
}

