	var query_str = '';
	var focus_page = '';
	var xmlHttp=null;
	
	var focus_popup = null; 
	var bdown = false;
	var focus_mid = null;
	var focus_sid = null;
	var focus_tid = null;
	var x, y; 
	function createXMLHttpRequest() { //아자스 객체 생성
    	if (window.ActiveXObject) {
       		xmlHttp = new ActiveXObject("Microsoft.XMLHTTP");
	    }else if (window.XMLHttpRequest) {
	        xmlHttp = new XMLHttpRequest();
    	}
	}

	function get_second_group(val) {
		url = "/admin/system/s_group.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function get_second_group_gigi(val) {	//by kkwon 2009.10.08 휴대기기 검색
		url = "/admin/system/s_group_gigi.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetTmlist_gigi;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function get_second_type(val) {
		url = "/site/common/s_group.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function get_second_type_mobile(val) {	//by kkwon 2009.08.18 모바일 기기 검색
		url = "/site/common/s_group_mobile.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetTmlist_mobile;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function handleGetTmlist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_cate").innerHTML = xmlHttp.responseText;
				get_third_type();
        	}
    	}
	}

	function handleGetTmlist_mobile() {			//출력할 위치 지정(div name)  by kkwon 2009.08.19 모바일 기기검색
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_catem").innerHTML = xmlHttp.responseText;
				get_third_type_mobile();
        	}
    	}
	}

	function handleGetTmlist_gigi() {			//출력할 위치 지정(div name)  by kkwon 2009.10.08 휴대기기 검색
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_categ").innerHTML = xmlHttp.responseText;
				get_third_group_gigi();
        	}
    	}
	}

	function get_third_group(val) {
		 url = "/admin/system/t_group.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThird;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function get_third_group_gigi(val) {  //by kkwon 10.08 휴대기기 검색
		 url = "/admin/system/t_group_gigi.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThird_gigi;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function get_third_type(val) {
		 url = "/site/common/t_group.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThird;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function get_third_type_mobile(val) {	//by kkwon 2009.08.18 모바일 기기검색
		 url = "/site/common/t_group_mobile.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThird_mobile;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function get_fourth_type_mobile(val) {	//by kkwon 2009.08.18 모바일 기기검색
		 url = "/site/common/l_group_mobile.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetFourth;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function handleGetThird() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("t_cate").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function handleGetThird_gigi() {			//출력할 위치 지정(div name) //by kkwon 10.08 휴대기기 검색
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("t_categ").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function handleGetThird_mobile() {			//출력할 위치 지정(div name) by kkwon 2009.08.19 모바일 기기 검색
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("t_catem").innerHTML = xmlHttp.responseText;
				get_fourth_type_mobile();
        	}
    	}
	}

	function handleGetFourth() {			//출력할 위치 지정(div name) by kkwon 2009.08.18
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("l_catem").innerHTML = xmlHttp.responseText;
        	}
    	}
	}



	function get_second_category(val) {
		url = "/admin/system/s_cate.php?time=" + new Date().getTime();
		query_str = "mid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetCatelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}


	function get_post_group(mid,sid,tid) {
		url = "/site/device/s_group.php?time=" + new Date().getTime();
		query_str = "gid=" + mid + "&s_id=" + sid ;
		focus_sid = sid;
		focus_tid = tid;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetSeclist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);

	}

	function get_post_group_gigi(mid,sid,tid) {	//by kkwon 2009.10.08 휴대기기 검색
		url = "/site/device/s_group_gigi.php?time=" + new Date().getTime();
		query_str = "gid=" + mid + "&s_id=" + sid ;
		focus_sid = sid;
		focus_tid = tid;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetSeclist_gigi;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);

	}

	function get_post_group_mobile(mid,sid,tid,lid) {   //by kkwon 2009.08.18 모바일 기기검색
		//alert(mid + ' ' + sid + ' ' + tid + ' ' + lid);
		alert(mid);
		url = "/site/device/s_group_mobile.php?time=" + new Date().getTime();
		query_str = "gid=" + mid + "&s_id=" + sid ;
		focus_sid = sid;
		focus_tid = tid;
		focus_lid = lid;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetSeclist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);

	}

	function handleGetSeclist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_cate").innerHTML = xmlHttp.responseText;
				get_thr_post();
        	}
    	}
	}

	function handleGetSeclist_gigi() {			//출력할 위치 지정(div name) by kkwon 10.08 휴대기기 검색
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_categ").innerHTML = xmlHttp.responseText;
				get_thr_post();
        	}
    	}
	}

	function get_thr_post_group(sid,tid) {
		url = "/site/device/t_group.php?time=" + new Date().getTime();
		query_str = "gid=" + sid + "&t_id=" + tid ;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThird;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);

	}


	function get_thr_post() {
		get_thr_post_group(focus_sid,focus_tid);
	}

	function get_sec_category(val) {
		url = "/site/mycontents/s_cate.php?time=" + new Date().getTime();
		query_str = "mid=" + val;


		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}




	function get_sec_my_category(val) {
		url = "/site/mycontents/s_cate.php?time=" + new Date().getTime();
		query_str = "mid=" + val;


		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetMylist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}


	function handleGetMylist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_cate").innerHTML = xmlHttp.responseText;
        	}
    	}
	}
	function get_cate_category(val) {
		url = "/site/mycontents/common_scate.php?time=" + new Date().getTime();
		query_str = "mid=" + val;


		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleCategoryUpdate;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function handleCategoryUpdate() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("scate_ajax").innerHTML = xmlHttp.responseText;
        	}
    	}
	}
	function Cate2inner(pk) {
		document.MainForm.cate_2.value = pk;
	}

//  igensoft  파일서버 연동 ajax
	function get_file_list(pk, bbs_type) {

		url = "/site/mycontents/sub_lib/get_file_list.php?time=" + new Date().getTime();
		query_str = "idx=" + pk + "&bbs_type=" + bbs_type;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetFilelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		
		xmlHttp.send(query_str);		
	}

	function get_file_convert_list(pk, bbs_type) {
		url = "/site/mycontents/sub_lib/get_convert_list.php?time=" + new Date().getTime();
		query_str = "idx=" + pk + "&bbs_type=" + bbs_type;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetFilelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");		
		xmlHttp.send(query_str);		
	}

	function handleGetFilelist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("ajax_view").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function get_sec_mod_category(mid, sid) {
		url = "/site/mycontents/s_cate.php?time=" + new Date().getTime();
		query_str = "mid=" + mid +"&s_id=" + sid;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetModelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function handleGetModelist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_cate").innerHTML = xmlHttp.responseText;
//				get_third_type();
        	}
    	}
	}

	function get_convert_check() {
		url = "/site/mycontents/";
	}
		
	function get_second_device(val) {
		url = "/site/mycontents/s_device.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}
 
	function get_third_device(val) {
		document.getElementById("s_grb").value = val;
		 url = "/site/mycontents/t_device.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThird;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);

	}
		
	function cateThrInner(val) {
		document.getElementById("t_grb").value = val;
	}

	function get_convert_submit() {
		url = "./mycontents_convert.php";
		//var gb_f = document.getElementById("f_grb").value;
		//var gb_s = document.getElementById("s_grb").value;
		//var gb_t = document.getElementById("t_grb").value;
		var idx = document.getElementById("conv_id").value;
		var fid = document.getElementById("conv_fid").value;
		var p = document.getElementById("p").value;  //페이지번호 2009-12-26
		query_str = "idx=" + idx+"&fid="+fid+"&p="+p;
		var str_temp = createQueryStringOrder();

		if(str_temp == '') {
			return false;
		} else {
			var add_temp = Convert();
			if(!add_temp) {
				return false;
			} else {
				popOpen('convertIng');
				post_header = query_str + str_temp + add_temp;
				document.location.href="./mycontents_convert.php?" + post_header;
			}
		}
	}

	function createQueryStringOrder(){ //아자스 상품 추가 쿼리 생성
		f = document.c_srch_form;
		var str_temp = '';
		for(c=0;c<f.length;c++){
			var e = f.elements[c];
			if(e.type != 'button'){
				if(e.checked == true) {
					str_temp += '&' + e.name + '=' + e.value;
				}
			}
		}
		if(str_temp == '') {
			alert("변환타입을 체크하십시요.");
			return false;
		} else {
			return str_temp;
		}
	}

function get_convert_submit_all() { //by kkwon 11.04
		url = "./mycontents_convert.php";
		//var gb_f = document.getElementById("f_grb").value; //by kkwon 11.02
		//var gb_s = document.getElementById("s_grb").value;
		//var gb_t = document.getElementById("t_grb").value;
		var idx = document.getElementById("conv_id_all").value;  //게시물 번호
		var fid = document.getElementById("conv_fid_all").value;  //폴더번호
		var p = document.getElementById("p").value;  //페이지번호 2009-12-26
		
		query_str = "idx=" + idx+"&fid="+fid+"&p="+p;
		var str_temp = createQueryStringOrder_all();
		if(str_temp == '') {
			return false;
		} else {
			var add_temp = Convert_all();
			if(!add_temp) {
				return false;
			} else {
				popOpen('convertIng');
				post_header = query_str + str_temp + add_temp;
				document.location.href="./mycontents_convert.php?" + post_header;
			}
		}
	}
function Convert_all() { //by kkwon 11.04
	f = document.lsform;
	var str_temp = '';
	var check_obj = document.getElementsByName("check[]");
	var status_obj = document.getElementsByName("status[]");
	var chk_convert = true;
	var chk_val = 0;  //체크박스 유무
	var chk_ext = 0; //확장자 정상 유무
	var chk_upload = 0; //업로드 중 유무



	for(var i = 0; i < check_obj.length; i++) {
	  if(check_obj[i].checked == true) {
		var file = check_obj[i].value	//by kkwon 11.03 확장자 필터링		
		var file_arr_pre = file.split("||");
		var file_arr_pre1 = file_arr_pre[1]; //변환신청할 데이타
		var file_arr_next = file_arr_pre1.split("|");
		
		for(var j=0; j < file_arr_next.length; j++) {
			file_arr = file_arr_next[j].split("-*-");
			var exten = file_arr[5]
			if(exten == "smi" || exten == "SMI") {
				str_temp = str_temp + "&caption_id[]=" + file_arr[0];
				cap_chk = "Y";
			} else {
				str_temp = str_temp + "&inode[]=" + file_arr[0];  // 08.10 마은진 - 자막 파일 우선 건너뜀
				chk_val += 1;
				cap_chk = "N";
			}			
		} 
	  }
	}
	return str_temp;
} 

function createQueryStringOrder_all(){ //by kkwon 11.04
	f = document.c_srch_form_all;
	
	var str_temp = '';
	for(c=0;c<f.length;c++){
		var e = f.elements[c];
		if(e.type != 'button'){
			if(e.checked == true) {
				str_temp += '&' + e.name + '=' + e.value;
			}
		}
	}
	
	if(str_temp == '') {
		alert("변환타입을 체크하십시요.");
		return false;
	} else {
		return str_temp;
	}
}

	function handleGetProcess() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("ajax_convert").innerHTML = xmlHttp.responseText;
				popClose('mobileType');
        	}
    	}
	}
	function wait_list(){  //아자스 회원 검색시 로딩중 출력
		document.getElementById("img_layer").innerHTML = "<table align='center' border='0' height='200' width='500' bgcolor='#FBFAF7'><tr><td align='center' valign='middle'>페이지로딩중...</td></tr></table>";
	}
function get_device_send() {
	f = document.lsform;
	F = document.deviceform;
	var m_cate = F.m_cate.value;
	var s_cate = F.cate_2.value;
	url = "/site/mycontents/mycontents_edit_ok.php?mode=device_send";
	query_str = "m_cate=" + m_cate + "&s_cate=" + s_cate;
	var str_temp = createQueryString();
	post_header = query_str + str_temp;

	createXMLHttpRequest();
	xmlHttp.open("POST", url, true);
    xmlHttp.onreadystatechange = handleGetDevice;
	xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
	
	xmlHttp.send(post_header);

}

	function handleGetDevice() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("ajax_device").innerHTML = xmlHttp.responseText;
				test = document.getElementById("work_result");
				str = document.getElementById("work_str");
				if(test.name == 'ok') {
					alert("파일광장에 보냈습니다.");
					location.reload();
				} else {
					alert(str);
				}
        	}
    	}
	}
function createQueryString(){ //아자스 상품 추가 쿼리 생성
	f = document.lsform;
	var str_temp = '';
	for(c=0;c<f.length;c++){
		var e = f.elements[c];
		if(e.type == 'checkbox'){
				if(e.checked == true) {
					str_temp += '&' + e.name + '=' + e.value;
				}
		}
	}
	return str_temp;
}


	function get_second_vod(val) {
		url = "/site/common/s_vod.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetSrch;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}


	function handleGetSrch() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_srch").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function get_third_vod(val) {
		 url = "/site/common/t_vod.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThirdSrch;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function handleGetThirdSrch() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("t_srch").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function get_srch_mobile() {
		f = document.m_serch_form;
		var f_id = f.f_id.value;
		var s_id = f.s_id.value;
		var t_id = f.t_id.value;

		url = "/site/common/mobileType.php";
		query_str = "f_id=" + f_id + "&s_id=" + s_id + "&t_id=" + t_id;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetMobileType;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function handleGetMobileType() {
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("mobileType_view").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function get_file_size(idx) {
		url = "/site/mycontents/file_size_list.php";
		query_str = "idx=" + idx;
		createXMLHttpRequest();
		xmlHttp.open("GET", url, true);
	    xmlHttp.onreadystatechange = handleGetFileSize;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}
	function handleGetFileSize() {
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("file_size_ajax").innerHTML = xmlHttp.responseText;
				test = document.getElementById("result_size");
				alert(test.name);
				if(test.name) {
					document.getElementById("filesize").innerHTML = test.name;
				}
        	}
    	}
	}

	function get_receive_list(year,month,id) {
		url = "/site/mycontents/sub_lib/get_receive_list.php";
		query = "year=" + year + "&month=" + month + "&user_id=" + id;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetReceive;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		if(query_str == ''){
			post_header = query + "&page=" + focus_page;
		}else {
			post_header = query + query_str + '&page=' + focus_page;
		}

		xmlHttp.send(post_header);
	}

	function handleGetReceive() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("ajax_view").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function serch_btn(id) {
		var f = document.srchform;
		var srch_year = f.srch_year.value;
		var srch_month = f.srch_month.value;
		query_str = "&keyword=" + f.keyword.value;
		get_receive_list(srch_year,srch_month,id);
	}

	function get_convert_vod(val) {
		url = "/site/common/c_sec_vod.php?time=" + new Date().getTime();
		query_str = "gid=" + val ;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetConv;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}


	function handleGetConv() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("s_grb").innerHTML = xmlHttp.responseText;
				get_convert_sec_vod('');
        	}
    	}
	}

	function get_convert_sec_vod(val) {
		 url = "/site/common/c_thr_vod.php?time=" + new Date().getTime();
		 query_str = "gid=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleGetThirdConv;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function handleGetThirdConv() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("t_grb").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function get_convert_mobile() {
		f = document.c_srch_form;
		var f_id = f.f_grb.value;
		var s_id = f.s_id.value;
		var t_id = f.t_id.value;

		url = "/site/common/mobileType.php";
		query_str = "f_id=" + f_id + "&s_id=" + s_id + "&t_id=" + t_id;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleConvertMobileType;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		
		xmlHttp.send(query_str);
	}

	function handleConvertMobileType() {
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("mobileConvert_view").innerHTML = xmlHttp.responseText;
        	}
    	}
	}


	function cate_list(key, pk) {
		url = "/site/common/cate_list.php";
		query_str = "device_id=" + key + "&category_id=" + pk;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handlePostTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function cate_list_ajax(key, pk) {  //by kkwon 2009.08.25 디바이스파일광장 ajax list
		url = "/site/common/cate_list_ajax.php";
		query_str = "device_id=" + key + "&category_id=" + pk;

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handlePostTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function handlePostTmlist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("ajax_view").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function mobile_list(pk) {
		url = "/site/common/mobile_cate.php";
		query_str = "category_id=" + pk;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handlePostTmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function m_cate_list(key, pk) {
		url = "/site/common/m_cate_list.php";
		query_str = "device_id=" + key + "&category_id=" + pk;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handlePost2Tmlist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function handlePost2Tmlist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("m_ajax_view").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function get_srch_list(device, cate_1,cate_2) {
		if(!cate_2) {
			cate_2 = '';
		}
		url = "/site/common/get_device_list.php";
		
		query_str = "device_id=" + device + "&cate_1=" + cate_1 +"&cate_2=" + cate_2;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleDevicelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

		if(query_str == ''){
			post_header = 'page=' + focus_page;
		}else {
			post_header = query_str + '&page=' + focus_page;
		}

		xmlHttp.send(post_header);
	}

	function handleDevicelist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("device_ajax").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function serchDevicePage(page,device,cate_1,cate_2) {
		focus_page = page;
		get_srch_list(device,cate_1,cate_2);
	}

	
	function get_sort_list(link,strlink) {
		url = "/site/common/get_device_list.php";
		
		query_str = link + "&" + strlink;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleDevicelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

		if(query_str == ''){
			post_header = 'page=' + focus_page;
		}else {
			post_header = query_str + '&page=' + focus_page;
		}

		xmlHttp.send(post_header);
	}

	function get_mobile_cate(cate_1,cate_2) {
		if(!cate_2) {
			cate_2 = '';
		}
		url = "/site/common/get_mobile_cate.php";
		
		query_str = "cate_1=" + cate_1 +"&cate_2=" + cate_2;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleMobileDevicelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

		if(query_str == ''){
			post_header = 'page=' + focus_page;
		}else {
			post_header = query_str + '&page=' + focus_page;
		}

		xmlHttp.send(post_header);
	}
	function handleMobileDevicelist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("mobile_device_ajax").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function listMobile(c_id,mode) {
		url = "/site/common/mobileMenu.php";
		query_str = "category=" + c_id+'&mode='+mode;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
	    xmlHttp.onreadystatechange = handleMobilelist;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

		xmlHttp.send(query_str);
	}
	function handleMobilelist() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("mobile_menu_ajax").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function checkMobileSelect() {
		f = document.lsform;
		var str_temp = '';
		var str_num = 0;
		var noteFr = document.all.to_id.value;
		for(c=0;c<f.length;c++){
			var e = f.elements[c];
			if(e.type == 'checkbox') {
				if(e.checked == true) {
					if(e.name != 'checkall') {
						chk = e.value.split("-*-");
						if(!chk[5]) { 
							alert("모바일로 전송할 수 없는 기기유형이 있습니다.");
							return false;
						}
						str_temp += '&' + e.name + '=' + e.value;
						noteFr = noteFr + e.value + ',';
						str_num = eval(str_num) + 1;
					}
				}
			}
		}

		if(!str_temp) {
			alert("파일을 선택하십시요.");
			return false;
		} else {
				popOpen('popMobile02');
				url = "/site/device/mobile_send.php";
				query_str = str_temp + "&rType=2";
				createXMLHttpRequest();
				xmlHttp.open("POST", url, true);
			    xmlHttp.onreadystatechange = handleMobileSend;
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

				xmlHttp.send(query_str);
		}		
	}

	function checkMobileSelect_New(val) {  //2009-12-30
		if(!val) {
			alert("전송할 데이타가 없습니다.");
			return false;
		} else {
				popOpen('popMobile02');
				url = "/site/device/mobile_send.php";
				query_str = "&rType=1&idx=" + val;
				createXMLHttpRequest();
				xmlHttp.open("POST", url, true);
			    xmlHttp.onreadystatechange = handleMobileSend;
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

				xmlHttp.send(query_str);
		}		
	}

	function handleMobileSend() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("popMobile02").innerHTML = xmlHttp.responseText;
        	}
    	}
	}


	function checkMobileForm() {
		f = document.lsform;
		var str_temp = '';
		var str_num = 0;
		var noteFr = document.all.to_id.value;
		for(c=0;c<f.length;c++){
			var e = f.elements[c];
			if(e.type == 'checkbox') {
				if(e.checked == true) {
					if(e.name != 'checkall') {
						str_temp += '&' + e.name + '=' + e.value;
						noteFr = noteFr + e.value + ',';
						str_num = eval(str_num) + 1;
					}
				}
			}
		}

		if(!str_temp) {
			alert("파일을 선택하십시요.");
			return false;
		} else {
				popOpen('popMobile02');
				url = "/site/device/mobile_view.php";
				query_str = str_temp + "&rType=2";
				createXMLHttpRequest();
				xmlHttp.open("POST", url, true);
			    xmlHttp.onreadystatechange = handleMobileSend;
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

				xmlHttp.send(query_str);
		}		
	}

	function handleMobileView() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("popMobile").innerHTML = xmlHttp.responseText;
        	}
    	}
	}

	function MobileDirect(val) {
		popOpen('popMobile02');
		url = "/site/device/mobile_send.php";
		query_str = "&rType=1&idx=" + val;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
		xmlHttp.onreadystatechange = handleMobileSend;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}


	function MobileSendCheck() {
		popOpen('popMobile02');
		inode = document.mForm.inode.value;
		url = "/site/device/mobile_send.php";
		query_str = "&rType=2&inode=" + inode;
		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
		xmlHttp.onreadystatechange = handleMobileCheck;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}
	function handleMobileCheck() {			//출력할 위치 지정(div name)
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("popMobile").innerHTML = xmlHttp.responseText;
        	}
    	}
	}
	function MobileSend() {
		var f = document.mbForm;
		if(!f.contents.value) {
			alert("메시지를 입력하십시요.");
			f.contents.focus();
			return false;
		}
		if(!f.sender.value) {
			alert("보내는 사람 핸드폰번호를 입력하십시요.");
			f.sender.focus();
			return false;
		}

		popClose('popMobile');
		popOpen('popMobile02');
		f.submit();
		return false;
	}

	function MobileSelect() {
		f = document.lsform;
		var str_temp = '';
		var str_num = 0;
		var noteFr = document.all.to_id.value;
		for(c=0;c<f.length;c++){
			var e = f.elements[c];
			if(e.type == 'checkbox') {
				if(e.checked == true) {
					if(e.name != 'checkall') {
						str_temp += '&' + e.name + '=' + e.value;
						noteFr = noteFr + e.value + ',';
						str_num = eval(str_num) + 1;
					}
				}
			}
		}

		if(!str_temp) {
			alert("파일을 선택하십시요.");
			return false;
		} else {
			if(str_num > 1) {
				alert("모바일 전송은 파일하나만 가능합니다.");
				return false;
			} else {
				popOpen('popMobile02');
				url = "/site/device/mobile_send.php";
				query_str = "shape=myself" + str_temp;
				createXMLHttpRequest();
				xmlHttp.open("POST", url, true);
			    xmlHttp.onreadystatechange = handleMobileSend;
				xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");

				xmlHttp.send(query_str);
			}
		}
	}

	function getMobileSend() {
		url = "http://61.106.26.26/sendMobSms.asp";
		var inode = document.mbForm.inode.value;
		var taker = document.mbForm["taker[]"][0].value;
		var sender = document.mbForm.sender.value;
		var nick_nm = document.mbForm.nick_nm.value;
		var contents = document.mbForm.contents.value;
		var rWinc = '1004';

		query_str = "rId=" + inode + "&rMdn=" + sender + "&dMdn=" + taker + "&rName=" + nick_nm + "&rWinc=" + rWinc + "&rMsg=" + encodeURIComponent(contents);

		createXMLHttpRequest();
		xmlHttp.open("POST", url, true);
		xmlHttp.onreadystatechange = handleMobileProcess;
		xmlHttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded");
		xmlHttp.send(query_str);
	}

	function handleMobileProcess() {
   		if(xmlHttp.readyState == 4) {
        	if(xmlHttp.status == 200) {
            	document.getElementById("mobile_ajax").innerHTML = xmlHttp.responseText;
        	}
    	}
	}


	function serchPage(page, year, month, user_id) {
		focus_page = page;
		get_receive_list(year,month,user_id);
	}
