////
// 화면에 표시
//
// @param	string msg : 응답 받은 text. 
//
function echoauth(msg) { document.getElementById("view").innerHTML = msg; }

////
// sendRequestBiz delegate 의 callback 함수.
//
// @param	object oj : sendRequest 함수에서 리턴받은 object
//
function on_loaded_com(oj)
{
	// TODO : 작업 시 필요한 선행작업. 즉, div 내용을 매꾸기 전 작업
    var res = decodeURIComponent(oj.responseText);
    echoauth(res);
}

function on_loaded_alert(oj)
{
	// TODO : 작업 시 필요한 선행작업.
    var res = decodeURIComponent(oj.responseText);
    alert(res);
}

////
// sendRequest 의 비지니스 함수
//
// @param	string dir : 해당 파일의 서버 상대주소
// @param	string URL : 해당 파일의 파일명
// @param	string param : 해당 파일로 보낼 data
//
function sendRequestBiz(dir, URL, param)
{
    if ( dir == '') { sendRequest(on_loaded_com, param, 'GET', URL, true, true); }
    else { sendRequest(on_loaded_com, param, 'GET', dir+'/'+URL, true, true); }
}

function sendRequestAlert(dir, URL, param)
{
	if ( dir == '') { sendRequest(on_loaded_alert, param, 'GET', URL, true, true); }
    else { sendRequest(on_loaded_alert, param, 'GET', dir+'/'+URL, true, true); }
}