 
 //리포터등록시 파일업로드 실행하는 스크립트 : 20080131 김기성
 function fileUploadService(type, module, file_count, callback) {
 	popupWindow("/visit2008service/common/fileUpload.do?method=select&Module=" + module + "&Type=" + type + "&file_count=" + file_count + "&callback=" + callback, 'fileupload', "");
 }
 
 function fileUpload(type, module, file_count, callback) {
 	popupWindow("/visit2008admin/common/fileUpload.do?method=select&Module=" + module + "&Type=" + type + "&file_count=" + file_count + "&callback=" + callback, 'fileupload', "");
 }
 
 function fileReuse(module, callback) {
 	popupWindow("/visit2008admin/common/fileReuse.do?method=select&find_class=" + module + "&callback=" + callback, 'filereuse', "");
 }
  
function popupWindow(Url, windowName, scroll){
   if((scroll==null) || (scroll=="")){
	   scroll = "no";
   }

   //var win = window.open(Url,windowName,"toolbar=no,location=no,directory=no,status=no,menubar=no,scrollbars="+ scroll +",resizable=no,top=200,left=300,width="+ Width +",height="+ Height);
   //var win = window.open(Url, windowName, "toolbar=no, location=no");
   var win = window.open(Url, windowName, "status=no,toolbar=no,resizable=no,scrollbars="+scroll+",menubar=no, width=500, height=150, left=300, top=200"); 
   win.focus();
   //win.opener.self;
}

//tongky : 20071122 
function popup_category(ctl_name, count_num, callback){
	var popup_url = '/visit2008admin/jp/adm_classcode/category_code/category.do?method=popup' +
					'&num=' + count_num + '&callback=' + callback;
	
	//콘트롤위치 설정함
	var ctl_obj = document.getElementsByName(ctl_name)[0];
	var ctl_pos = findCtlPos(ctl_obj);
	
	setDivShow('ifCategory', 'divCategory', popup_url, ctl_pos);
	//콘트롤위치 설정함
}

//tongky : 20071127
function popup_area(ctl_name, count_num, curr_num, callback, callback_compare){
	var parentcode = "06000000";
	var popup_url = '/visit2008admin/jp/adm_classcode/common_code/comm_code.do?method=popup&exec_id=' + parentcode + 
					'&num=' + count_num + '&curr_num=' + curr_num + '&callback=' + callback + '&callback_compare=' + callback_compare;
	
	//콘트롤위치 설정함
	var ctl_obj = document.getElementsByName(ctl_name)[0];
	var ctl_pos = findCtlPos(ctl_obj);
	
	setDivShow('ifArea', 'divArea', popup_url, ctl_pos);
	//콘트롤위치 설정함
}

//tongky : 20071129
function popup_relate_img(ctl_name, exec_id, callback){
	var com_id = document.getElementsByName('comimg_id')[0].value;	//thisform.comimg_id.value;
	var popup_url = '/visit2008admin/jp/adm_article/article_register/relate_popup.do?method=relate_image&exec_id=' + exec_id +
					'&com_id=' + com_id + '&callback=' + callback;
	
	//콘트롤위치 설정함
	var ctl_obj = document.getElementsByName(ctl_name)[0];
	var ctl_pos = findCtlPos(ctl_obj);
	
	setDivShow('ifRelateImg', 'divRelateImg', popup_url, ctl_pos);
	//콘트롤위치 설정함
	
}

//tongky : 20071129 popup_relate_article('gal_name', '500059', 'GL', 'SetRelArticleCallback');
function popup_relate_article(ctl_name, exec_id, com_type, callback){
	var com_id = '';
	if(com_type == 'GL')
		com_id = document.getElementsByName('gal_id')[0].value;
	else if(com_type == 'ML')
		com_id = document.getElementsByName('mov_id')[0].value;	
	else if(com_type == 'PL')
		com_id = document.getElementsByName('pef_id')[0].value;
	else if(com_type == 'RL')
		com_id = document.getElementsByName('com_id')[0].value;
	else if(com_type == 'LL')
		com_id = document.getElementsByName('pls_id')[0].value;	
							
	var popup_url = '/visit2008admin/jp/adm_article/article_register/relate_popup.do?method=relate_article&exec_id=' + exec_id +
					'&com_type=' + com_type + '&com_id=' + com_id + '&callback=' + callback;
	
	//콘트롤위치 설정함
	var ctl_obj = document.getElementsByName(ctl_name)[0];
	var ctl_pos = findCtlPos(ctl_obj);
	
	setDivShow('ifRelateArticle', 'divRelateArticle', popup_url, ctl_pos);
	//콘트롤위치 설정함
}

//tongky : 20071128
function popup_addr_gu(ctl_name, lang_type, callback){
	var popup_url = '/visit2008admin/common/addr_gu_popup.do?method=popup' + 
					'&lang_type=' + lang_type + '&callback=' + callback;
	
	//콘트롤위치 설정함
	var ctl_obj = document.getElementsByName(ctl_name)[0];
	var ctl_pos = findCtlPos(ctl_obj);
	
	setDivShow('ifAddrGu', 'divAddrGu', popup_url, ctl_pos);
	//콘트롤위치 설정함
}

//스크롤 설정과 DIV설정 
function setDivShow(iframe_name, div_name, popup_url, ctl_pos){

	document.getElementById(iframe_name).src = popup_url;	//주소이동
	var topMenuTerm = 150;	//탑메뉴 높이는 빼야함 
	var setScrollPos = ctl_pos.y - parseInt(document.getElementById(iframe_name).height);
	if(setScrollPos < 0)
		setScrollPos = ctl_pos.y - topMenuTerm;
		
	//alert(document.body.scrollTop + ":" + setScrollPos);
	document.body.scrollTop = setScrollPos;	//스크롤위치
	document.getElementById(div_name).style.top = ctl_pos.y; //위치설정
	document.getElementById(div_name).style.left = ctl_pos.x;	//위치설정
	document.getElementById(div_name).style.display = ''; //DIV 활성화
}


// 이미지 갤러리 보기
function PhotoGalleryView(lang_type, gim_id) {
	if (lang_type == 'ck') {
		window.open('/visit2008ck/seoul/gallery.do?method=photo_view&gim_id=' + gim_id, "photo_view","'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=768,height=650, left=20, top=20");
	}		
	else if (lang_type == 'jp') {
		window.open('/visit2008jp/travel/gallery.do?method=photo_view&gim_id=' + gim_id, "photo_view","'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=765,height=650, left=20, top=20");
	}		
	else if (lang_type == 'cb') {
		window.open('/visit2008cb/seoul/gallery.do?method=photo_view&gim_id=' + gim_id, "photo_view","'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=760,height=630, left=20, top=20");
	}				
}

// 동영상 갤러리 보기
function MovieGalleryView(lang_type, mov_id) {
	if (lang_type == 'ck') {
		window.open('/visit2008ck/seoul/gallery.do?method=movie_view&mov_id=' + mov_id, "movie_view","'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=550,height=480, left=20, top=20");
	}
	else if (lang_type == 'jp') {
		window.open('/visit2008jp/travel/gallery.do?method=movie_view&mov_id=' + mov_id, "movie_view","'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=500,height=775, left=20, top=20");
	}		
	else if (lang_type == 'cb') {
		window.open('/visit2008cb/seoul/gallery.do?method=movie_view&mov_id=' + mov_id, "movie_view","'toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no,width=550,height=560, left=20, top=20");
	}		
}