 var obj_xmlhttp;
 var call_func;

 // Get ¹æ½ÄÈ£Ãâ
 function GetAjaxInfoA(b_async,s_url,callback_func) {
    obj_xmlhttp = zXmlHttp.createRequest()
    obj_xmlhttp.open("get",s_url,b_async);

	if(b_async) {
	   call_func = eval(callback_func)
	   obj_xmlhttp.onreadystatechange = GetResponseText;
	   obj_xmlhttp.send(null);
	} else {
	   obj_xmlhttp.send(null);

	   if(obj_xmlhttp.readyState == 4) {
		  if(obj_xmlhttp.status == 200) {
			 return obj_xmlhttp.responseText
		  } else {
			 return "-1[sp]An error occurred: " + obj_xmlhttp.statusText
		  }            
	   }
	}
 }

 // Post ¹æ½Ä
 function GetAjaxInfoB(b_async,f_obj,callback_func) {
	var html_body

    html_body = GetParamInfo(f_obj);

    obj_xmlhttp = zXmlHttp.createRequest()
    obj_xmlhttp.open("post",f_obj.action,b_async);
    obj_xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded;charset=euc-kr");

	if(b_async) {
	   call_func = eval(callback_func)
	   obj_xmlhttp.onreadystatechange = GetResponseText;
	   obj_xmlhttp.send(html_body);
	} else {
	   obj_xmlhttp.send(html_body);
	   if(obj_xmlhttp.readyState == 4) {
		  if(obj_xmlhttp.status == 200) {
			 return obj_xmlhttp.responseText
		  } else {
			 return "-1[sp]An error occurred: " + obj_xmlhttp.statusText
		  }            
	   }
	}

	
 }

 // °á°úµ¥ÀÌÅÍ ¾ò¾î¿À±â
 function GetResponseText() {
	if(obj_xmlhttp.readyState == 4) {
	   if(obj_xmlhttp.status == 200) {
		  return call_func(obj_xmlhttp.responseText)
	   } else {
		  return call_func("-1[sp]An error occurred: " + obj_xmlhttp.statusText)
	   }
	}  
 }

 function GetParamInfo(oForm) {
	var aParams = new Array();
	var sParam, form_check, i, j

	for (i=0 ; i < oForm.elements.length; i++) {	
		form_check = oForm.elements[i].type != "radio" && oForm.elements[i].type != "checkbox"
		form_check = form_check && oForm.elements[i].type != "select-multiple"
		form_check = form_check || (oForm.elements[i].type == "radio" && oForm.elements[i].checked)
		form_check = form_check || (oForm.elements[i].type == "checkbox" && oForm.elements[i].checked)
		if(form_check) {
		   sParam = escape(oForm.elements[i].name);
		   sParam += "=";
		   sParam += escape(oForm.elements[i].value);
		   aParams.push(sParam);
		} else if(oForm.elements[i].type == "select-multiple" && oForm.elements[i].value != "") {
		   for(j=0;j<oForm.elements[i].options.length;j++) {
			   if(oForm.elements[i].options[j].selected) {
			      sParam = escape(oForm.elements[i].name);
			      sParam += "=";
			      sParam += escape(oForm.elements[i].options[j].value);
			      aParams.push(sParam);			   
			   }
		   }	
		}
	} 
	
	return aParams.join("&");        
 }
