// 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();
}

// Price ÆÄÀÏ ´Ù¿î·Îµå
function cf_price_download(fm, seq, s, d){
	fm.s.value = s;
	if (d != null)
		fm.d.value = d;
	if (seq != null)
		fm.pricesSeq.value = seq;
	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, 760, 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 +="<li><a href=\"#\" onclick=\"jf_setFontSize('magnify')\"><img src=\"/image/home/icons/ico_amplify.gif\" id=\"font-size-bigger\" alt=\"Å©°Ôº¸±â\" /></a></li>";
	htmlCode +="<li><a href=\"#\" onclick=\"jf_setFontSize('reduce')\"><img src=\"/image/home/icons/ico_narrow.gif\" id=\"font-size-smaller\" alt=\"ÀÛ°Ôº¸±â\" /></a></li>";
	htmlCode +="<li><a href=\"#\" onClick=\"javascript:jf_setFontSize('restore');\"><img src=\"/image/home/icons/ico_restore.gif\" alt=\"¿ø·¡Å©±â\" /></a></li>";
	htmlCode +="<li class=\"pr_5\"><a href=\"#\" onClick=\"javascript:jf_openWindow('"+rtnURL+"', 'markWindow',0,0,365,285,365,365,0);\"><img src=\"/image/home/icons/ico_favorite.gif\" alt=\"Áñ°ÜÃ£±â\" /></a></li>";
	htmlCode +="<li class=\"pr_0\"><a href=\"#\" onClick=\"javascript:printIt(document.getElementById('contern').innerHTML);\"><img src=\"/image/home/icons/ico_print.gif\" alt=\"ÀÎ¼â\" /></a></li>";
	} else {
		htmlCode += "&nbsp;";
	}

	document.write(htmlCode);
}

// °ü±¤
function cf_selTourFuncBox(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 += "<a href=\"#\" onclick=\"javascript:jf_setFontSize('magnify');\"><img src=\"/image/tour/icons/ico01_conter.gif\" id=\"font-size-bigger\" alt=\"Å©°Ôº¸±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:jf_setFontSize('reduce');\"><img src=\"/image/tour/icons/ico02_conter.gif\" id=\"font-size-smaller\" alt=\"ÀÛ°Ôº¸±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:jf_setFontSize('restore');\"><img src=\"/image/tour/icons/ico03_conter.gif\" alt=\"¿ø·¡Å©±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:jf_openWindow('" + rtnURL + "', 'markWindow',0,0,365,285,365,365,0);\"><img src=\"/image/tour/icons/ico04_conter.gif\" alt=\"Áñ°ÜÃ£±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:printIt1(document.getElementById('content_main').innerHTML);\"><img src=\"/image/tour/icons/ico05_conter.gif\" alt=\"ÀÎ¼â\" /></a>";

	} else {
		htmlCode += "&nbsp;";
	}

	document.write(htmlCode);
}

// º¸°Ç¼Ò
function cf_selHealthFuncBox(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 += "<a href=\"#\" onclick=\"javascript:jf_setFontSize('magnify');\"><img src=\"/image/health/common/btn_01_01_01.gif\" alt=\"Å©°Ôº¸±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:jf_setFontSize('reduce');\"><img src=\"/image/health/common/btn_01_01_02.gif\" alt=\"ÀÛ°Ôº¸±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:jf_setFontSize('restore');\"><img src=\"/image/health/common/btn_01_01_03.gif\" alt=\"¿ø·¡Å©±â\" /></a>";
		htmlCode += "<a href=\"#\" onclick=\"javascript:printIt2(document.getElementById('contents').innerHTML);\"><img src=\"/image/health/common/btn_01_01_04.gif\" alt=\"ÀÎ¼â\" /></a>";
	} else {
		htmlCode += "&nbsp;";
	}

	document.write(htmlCode);
}

  var win=null;
  function printIt(printThis)  {
    win = window.open();
    self.focus();
    win.document.open();
    win.document.write("<html><head>");
    win.document.write("<link rel=\"stylesheet\" href=\"/common/styles/home/home.css\" type=\"text/css\" />");
	win.document.write("<link rel=\"stylesheet\" href=\"/common/bbs/bbs2.css\" type=\"text/css\" />");
    win.document.write("</head><body>");
    win.document.write(printThis);
    win.document.write("</body></html>");
    win.document.close();
    win.print();
    win.close();
  }
  function printIt1(printThis)  {
    win = window.open();
    self.focus();
    win.document.open();
    win.document.write("<html><head>");
    win.document.write("<link rel=\"stylesheet\" href=\"/common/styles/tour/tour.css\" type=\"text/css\" />");
	win.document.write("<link rel=\"stylesheet\" href=\"/common/bbs/bbs.css\" type=\"text/css\" />");
    win.document.write("</head><body>");
    win.document.write(printThis);
    win.document.write("</body></html>");
    win.document.close();
    win.print();
    win.close();
  }
  function printIt2(printThis)  {
    win = window.open();
    self.focus();
    win.document.open();
    win.document.write("<html><head>");
    win.document.write("<link rel=\"stylesheet\" href=\"/common/styles/health/health.css\" type=\"text/css\" />");
	win.document.write("<link rel=\"stylesheet\" href=\"/common/bbs/bbs2.css\" type=\"text/css\" />");
    win.document.write("</head><body>");
    win.document.write(printThis);
    win.document.write("</body></html>");
    win.document.close();
    win.print();
    win.close();
  }