// util.js가 열려진 상태에서
// 이미지 보기
function cf_imageView(picname){
	win = jf_openWindowRtn('about:blank', 'imgView', 'yes', 'yes', 700, 700, 1, 1, 0);
	var strData =""	;

	strData += "<html><head><title>이미지::전체보기</title></head><body leftmargin='0' topmargin='0' onload='resize()'>\n";
	strData += "<script language='javascript'>           		\n";
	strData += "function resize()                           \n";
	strData += "{                                           \n";
	strData += "	var p_height, p_width;                    \n";
	strData += "	p_width = document.img_view.width+40;     \n";
	strData += "	p_height = document.img_view.height+35;   \n";
	strData += "	if (p_width > 1024) p_width = 1024;       \n";
	strData += "	if (p_height > 768) p_height = 768;       \n";
	strData += "	self.resizeTo(p_width, p_height);         \n";
	strData += "}                                           \n";
	strData += "</script>                                   \n";
	strData += "<table border='0' cellspacing='0' cellpadding='0'><tr><td><a href='javascript:window.close();'><img name='img_view' src='" + picname + "' border='0'></a></td></td></table>\n";
	strData += "</body></html>\n";

	win.document.write(strData);
	win.location.reload()
}

// 우편번호
function cf_zipcode(zip, addr1){
	jf_openWindow('/app/zipcode/prc_zipcode_form.jsp?zipCode=' + zip + "&addr1="+addr1, 'formmail', 'no', 'yes', 363, 212, 1, 1, 1);
}

// 파일 다운로드
function cf_download(fm, s, d){
	fm.s.value = s;
	if (d != null)
		fm.d.value = d;
	fm.submit();
}
// 이메일 접근
function cf_emailck(val) {
	jf_openWindow('/app/email_prevention/prc_email_form.jsp?q=' + val, 'emailcheck', 'no', 'no', 345, 210, 1, 1, 1);
}

// 사용자 정보 보기
function cf_userInfo(memberID){
	jf_openWindow('/adm_site/app/member/pra_member_info.jsp?memberID=' + memberID, 'memberInfo', 0, 1, 700, 650, 1, 1, 1);
}

// 이미지 등록 
// sendForm: 이미지가 추가될 fckeditor 인스턴스  이름. 기본값 : content
function cf_imageForm(sendForm){
	var url = "/app/image_reg/prc_image_form.jsp";
	if(sendForm != null){
		url += "?sendForm=" + sendForm;
	}
	
	jf_openWindow(url, "imageForm", 0, 1, 550, 380, 1, 1, 1);  
}

// 로그인페이지 이동 여부 물어 보기  
function cf_loginConfirm(msg, rtnUrl){
	if(confirm(msg)){
		cf_login(rtnUrl);
	}
	else{
		history.back();
	}
}

// 콘텐츠 열람 팝업창 
function cf_contentView(articleID){
	jf_openWindow("/app/erms_xml/prc_erms_content_view.jsp?articleSeq="+articleID, "contentView", 0, 1, 650, 600, 1, 1, 1);  
}

function cf_selFuncBox(returnURL) {		// function버튼 IE, Firefox 처리
	var htmlCode = "";
	var rtnURL = "/app/enjoysearch/prc_enjoysearch_common.jsp?rtnUrl=" + returnURL;

	if (navigator.userAgent.toLowerCase().indexOf("msie") != -1){	// IE 인경우
		htmlCode += "<table border='0' cellspacing='0' cellpadding='0' id='funcFont'>";
		htmlCode +=	"	<tr>";
		htmlCode += "		<td>";
		htmlCode += "			<a href='#' onClick='javascript:jf_setFontSize(\"magnify\");'><img src='/image/home/common/fuc_+.gif' alt='크게보기' width='61' height='15' border='0'></a>";
		htmlCode += "			<a href='#' onClick='javascript:jf_setFontSize(\"reduce\");'><img src='/image/home/common/fuc_-.gif' alt='작게보기' width='61' height='15' border='0'></a>";
		htmlCode += "			<a href='#' onClick='javascript:jf_setFontSize(\"restore\");'><img src='/image/home/common/fuc_0.gif' alt='원래크기' width='59' height='15' border='0'></a>";
		htmlCode += "			<a href='#' onClick='javascript:jf_openWindow(\"" + rtnURL + "\", \"markWindow\",0,0,365,285,365,365,0);'><img src='/image/home/common/favorite.gif' alt='즐겨찾기' width='53' height='15' border='0'></a>";
		htmlCode += "			<a href='#' onClick='javascript:jf_print();'><img src='/image/home/common/fuc_print.gif' alt='인쇄' width='44' height='15' border='0'></a>";
		htmlCode += "		</td>";
		htmlCode += "	</tr>";
		htmlCode += "</table>";
	} else {
		htmlCode += "&nbsp;";
	}

	document.write(htmlCode);
}