	//±âº» ÀÚ¹Ù½ºÅ©¸³Æ®

	// ±âº» ¼³Á¤
	var isDOM = (document.getElementById ? true : false);
	var isIE4 = ((document.all && !isDOM) ? true : false);
	var isNS4 = (document.layers ? true : false);
	var isNS = navigator.appName == "Netscape";

	// ÁöÁ¤µÈ ´ë»óÀ» Ã£´Â´Ù.
	function getRef(id)
	{
		if(isDOM) return document.getElementById(id);
		if(isIE4) return document.all[id];
		if(isNS4) return document.layers[id];
	}

	// showBtn(¹öÆ°width, ½ÇÇàµÉÇÔ¼ö,¹öÆ°TEXT, ¹öÆ°icon,type)
	function showBtn(func,text,type,width,icon)
	{
		   // width ¸¦ ³ÖÀ¸¸é ¾ÆÀÌÄÜÀÇ Å©±â¸¦ Á¶Á¤ÇÒ ¼ö °¡ÀÖ´Ù. Áï ¿©¹éÀ» ÁÙÀÏ ¼ö ÀÖ´Ù.
		   var btn = "";
		   if(icon) icon = "<img src='"+icon+"'> ";
		   else icon = "";
		   var button_style = "background-color:transparent; color:transparent; cursor:hand; border:none; width:" + width;
			
			 if(type == "a")
			{
				// A Type
				btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
				btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
				btn += "    <tr style='height:23px;'>";
				btn += "      <td style='width:5px;' background='/images/admin/make_button/button_a_l.gif'></td>";
				btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/images/admin/make_button/button_a_c.gif'>" + icon + text + "</td>";
				btn += "      <td style='width:5px;' background='/images/admin/make_button/button_a_r.gif'></td>";
				btn += "    </tr>";
				btn += "  </table>";
				btn += "</button>";
			}
			else if(type == "b")
			{
				// B Type
				btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
				btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
				btn += "    <tr style='height:22px;'>";
				btn += "      <td style='width:5px;' background='/images/admin/make_button/button_b_l.gif'></td>";
				btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/images/admin/make_button/button_b_c.gif'>" + icon + text + "</td>";
				btn += "      <td style='width:5px;' background='/images/admin/make_button/button_b_r.gif'></td>";
				btn += "    </tr>";
				btn += "  </table>";
				btn += "</button>";
			}
			else
			{
				// Default Type
				btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
				btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
				btn += "    <tr style='height:18px;'>";
				btn += "      <td style='width:5px;' background='/images/admin/make_button/button_l.gif'></td>";
				btn += "      <td style='font-size:9pt; text-align:center; padding:0 5 0 5;' background='/images/admin/make_button/button_c.gif'>" + icon + text + "</td>";
				btn += "      <td style='width:5px;' background='/images/admin/make_button/button_r.gif'></td>";
				btn += "    </tr>";
				btn += "  </table>";
				btn += "</button>";
			}
		   document.write(btn);
	}
	function goUrl(url){
		if(url.indexOf("?") == -1) url += "?"+new Date().getTime();
		else url += "&"+new Date().getTime();
		location.href = url;
	}
	function goUrlConfirm(str,url){
		if(!confirm(str)) return;
		if(url.indexOf("?") == -1) url += "?"+new Date().getTime();
		else url += "&"+new Date().getTime();
		location.href = url;
	}
	function goUrlPrompt(arr){
		var tmpsubject = prompt('ÇöÀç ½ÅÃ»È¸¿øÀÇ ¹®ÀÇ»çÇ×¿¡ ´ëÇÑ È¸½Å ´äº¯¸ÞÀÏÀÔ´Ï´Ù. ¾Æ·¡ ´äº¯À» ÀÔ·ÂÇÏ½ÅÈÄ È®ÀÎÀ» Å¬¸¯ÇÏ¼¼¿ä!','½ÅÃ»ÇÏ½Å ÀÎÆ®¶ó³Ý È¸¿ø°¡ÀÔ°ÇÀÌ Ã³¸® µÇ¾ú½À´Ï´Ù.·Î±×ÀÎÈÄ ¹Ýµå½Ã °³ÀÎÁ¤º¸ ¼öÁ¤ÂÊ¿¡¼­ »çÁøÀ» Ã·ºÎÇØ ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù');
		if(tmpsubject != null){
			location.href = arr+"&add_body="+tmpsubject+"&"+new Date().getTime();
		}
	}


	//-- ÀÌ¹ÌÁö »çÀÌÁî·Î ÆË¾÷À» ¿­¾î¼­ º¸¿©ÁÖ±â --//
	function ViewImageOriginal(ifile,ix,iy,ititle) { 
		var win;
		var sWidth;
		var sHeight;
		var NS = (document.layers) ? 1 : 0;
		win = window.open("","imageviewer","width="+ix+",height="+iy+",menubar=no,toolbar=no,resizable=yes");
		if (NS) {
			sWidth = win.innerWidth;
			sHeight = win.innerHeight;
		} else {
			sWidth = win.document.body.clientWidth;
			sHeight = win.document.body.clientHeight;
		}
		/*
		if(sWidth!=ix || sHeight!=iy) {
			win.close();
			setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
			return;
		}
		*/
		win.document.open();
		win.document.write("<html><head><title>"+ititle+"</title>");
		win.document.write("</head><body>");
		win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
		win.document.write("<img src='"+ifile+"'></div></body></html>");
		win.document.close();
	}

	//-- ÀÌ¹ÌÁö »çÀÌÁî·Î ÆË¾÷À» ¿­¾î¼­ º¸¿©ÁÖ±â --//
	function ViewImage(ifile,ix,iy,ititle) { 
		var win;
		var sWidth;
		var sHeight;
		var NS = (document.layers) ? 1 : 0;
		
		if(ix > screen.availWidth) ix = screen.availWidth;
		if(iy > screen.availHeight) iy = screen.availHeight;

		win = window.open("","imageviewer","width="+ix+",height="+iy+",top=0,left=0,menubar=no,toolbar=no,resizable=yes");
		
		if (NS) {
			sWidth = win.innerWidth;
			sHeight = win.innerHeight;
		} else {
			sWidth = win.document.body.clientWidth;
			sHeight = win.document.body.clientHeight;
		}
		/*
		if(sWidth!=ix || sHeight!=iy) {
			win.close();
			setTimeout("ViewImage('"+ifile+"',"+ix+","+iy+",'"+ititle+"')", 250);
			return;
		}
		*/

		win.document.open();
		win.document.write("<html><head><title>"+ititle+"</title>");
		win.document.write("</head><body>");
		win.document.write('<div style="position:absolute;width:'+ix+'px;height:'+iy+'px;left:0px;top:0px">');
		win.document.write("<img src='"+ifile+"' onclick='self.close();' width="+ix+" heght="+iy+" ></div></body></html>");
		win.document.close();
	}

	// ¹Ù·Î°¡±â ¹öÆ° ¸¸µé±â 
	function go_button(url, text, icon, width, type)
	{
		if(url)
		{
			button("document.location.href='" + url + "'", text, icon, width, type);
		}
	}

	// »õÃ¢ ¿­±â
	function open_window(url, title, option)
	{
		window.open(url, title, option);
	}

	// »õÃ¢ ¿­±â
	function newWindow(url, title, option)
	{
		window.open(url, title, option);
	}

	// ¹®ÀÚ¿­ÀÇ ±æÀÌ
	function strlen(str)
	{
		var len = 0;

		for(i=0; i < str.length; i++)
		{
			var ch = str.charAt(i);
			// 2bytes ¹®ÀÚ
			if(escape(ch).length > 4)
			{
				len += 2;
			}
			// ÁÙ¹Ù²Þ Ç¥½Ã
			else if(ch == '\n')
			{
				if(str.charAt(i-1) != '\r')
					len += 1;
			}
/*
			// HTML ÅÂ±× º¯È¯ (&lt;, &gt;)
			else if(ch == '<' || ch == '>')
			{
				len += 4;
			}
*/
			else
			{
				len += 1;
			}
		}

		return len;
	}

	// Æ¯Á¤±æÀÌÀÌ³»·Î ¹®ÀÚ¿­ ÀÚ¸£±â
	function cut_str(str, limit)
	{
		var new_str = "";
		var len = 0;

		for(i=0; i < str.length; i++)
		{
			var ch = str.charAt(i);
			// 2bytes ¹®ÀÚ
			if(escape(ch).length > 4)
			{
				len += 2;
			}
			// ÁÙ¹Ù²Þ Ç¥½Ã
			else if(ch == '\n')
			{
				if(str.charAt(i-1) != '\r')
					len += 1;
			}
/*
			// HTML ÅÂ±× º¯È¯ (&lt;, &gt;)
			else if(ch == '<' || ch == '>')
			{
				len += 4;
			}
*/
			else
			{
				len += 1;
			}

			if(len > limit)
				break;

			new_str += ch;
		}

		return new_str;
	}

	// ¹öÆ° ¸¸µé±â 
	// <script>button("self.close()", "´Ý±â", "/image/close.gif", "80", "a")</script>
	function button(func, text, icon, width, type)
	{
		if(icon)
			icon = "<img src='" + icon+"' align='absmiddle' border='0'> ";
		else
			icon = "";

		var button_style = "background-color:transparent; color:transparent; cursor:hand; border:none; width:" + width;

		var btn = "";

		if(type == "a")
		{
			// A Type
			btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
			btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
			btn += "    <tr style='height:23px;'>";
			btn += "      <td style='width:5px;' background='/images/admin/make_button/button_a_l.gif'></td>";
			btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/images/admin/make_button/button_a_c.gif'>" + icon + text + "</td>";
			btn += "      <td style='width:5px;' background='/images/admin/make_button/button_a_r.gif'></td>";
			btn += "    </tr>";
			btn += "  </table>";
			btn += "</button>";
		}
		else if(type == "b")
		{
			// B Type
			btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
			btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
			btn += "    <tr style='height:20px;'>";
			btn += "      <td style='width:5px;' background='/images/admin/make_button/button_b_l.gif'></td>";
			btn += "      <td style='font-size:9pt; text-align:center; padding:2 0 0 0;' background='/images/admin/make_button/button_b_c.gif'>" + icon + text + "</td>";
			btn += "      <td style='width:5px;' background='/images/admin/make_button/button_b_r.gif'></td>";
			btn += "    </tr>";
			btn += "  </table>";
			btn += "</button>";
		}
		else
		{
			// Default Type
			btn += "<button onfocus='this.blur()' style='" + button_style + "' onClick=\"" + func + "\">";
			btn += "  <table width='" + width + "' cellspacing='0' cellpadding='0'>";
			btn += "    <tr style='height:18px;'>";
			btn += "      <td style='width:5px;' background='/images/admin/make_button/button_l.gif'></td>";
			btn += "      <td style='font-size:9pt; color:999999; text-align:center; padding:2 0 0 0;' background='/images/admin/make_button/button_c.gif'>" + icon + text + "</td>";
			btn += "      <td style='width:5px;' background='/images/admin/make_button/button_r.gif'></td>";
			btn += "    </tr>";
			btn += "  </table>";
			btn += "</button>";
		}

		document.write(btn);
	}

	

	// Æ¯Á¤ ÄÚµå Ãâ·Â
	function write_tag(tag)
	{
		document.write(tag);
	}

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	function write_flash(movie, width, height, quality, scale, wmode, FlashVars)
	{
		var tag = "<object width='"+width+"' height='"+height+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0'>";
		tag += "<param name=movie value='"+movie+"'>";

		if(quality != "") tag += "<param name=quality value='"+quality+"'>";
		if(scale != "") tag += "<param NAME=scale VALUE='"+scale+"'> ";
		if(wmode != "") tag += "<param name='wmode' value='"+wmode+"'>";
		if(FlashVars != "") tag += "<param name=FlashVars value='"+FlashVars+"'>";

		tag += "<embed src='"+movie+"' width='"+width+"' height='"+height+"'";
		if(FlashVars != "") tag += " FlashVars='"+FlashVars+"'";
		if(quality != "") tag += " quality='"+quality+"'";
		tag += " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";

		tag += "</object>";

		document.write(tag);
	}

	// ÇÃ·¡½Ã ÄÚµå Ãâ·Â
	function write_flash_id(movie, width, height, quality, scale, wmode, FlashVars,id)
	{
		var tag = "<object width='"+width+"' height='"+height+"' classid='clsid:D27CDB6E-AE6D-11cf-96B8-444553540000' codebase='http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0' id='"+id+"'>";
		tag += "<param name=movie value='"+movie+"'>";

		if(quality != "") tag += "<param name=quality value='"+quality+"'>";
		if(scale != "") tag += "<param NAME=scale VALUE='"+scale+"'> ";
		if(wmode != "") tag += "<param name='wmode' value='"+wmode+"'>";
		if(FlashVars != "") tag += "<param name=FlashVars value='"+FlashVars+"'>";

		tag += "<embed src='"+movie+"' width='"+width+"' height='"+height+"'";
		if(FlashVars != "") tag += " FlashVars='"+FlashVars+"'";
		if(quality != "") tag += " quality='"+quality+"'";
		tag += " pluginspage='http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash' type='application/x-shockwave-flash'></embed>";

		tag += "</object>";

		document.write(tag);
	}

	// °¢ »çÀÌÆ®·Î ÀÌµ¿ (& À» ^  À¸·Î º¯È¯ÇØÁÖ°í /lib/move_site.php ¿¡¼­´Â ¹Ý´ë·Î Ã³¸®ÇØ¼­ º¸³½´Ù.)
	function move_go_site(site,url_old){
		var url = url_old;
		while(url.indexOf("&") != -1){
			url = url.replace("&","^");
		}

		
		//-- /open_header.html ÆÄÀÏ¿¡¼­ DEFAULT_HTTP_URL º¯¼ö¸¦ ÇöÀç ¸ÞµðÄ³½ºÆ® ±âº» URL ·Î ¼ÂÆÃÇÑ´Ù. ÀÌÀ¯´Â ´Ù¸¥ ÁúÈ¯»çÀÌÆ®·Î ³Ñ¾î
		//-- °¡´Â header ÀÇ ÇÃ·¡½¬¿¡¼­ ÀÌ ÇÔ¼ö¸¦ È£Ãâ ÇÒ ¼ö ÀÖ±â ¶§¹®¿¡
		location.href = DEFAULT_HTTP_URL + "/lib/move_site.php?site="+site+"&url="+url+"&"+new Date().getTime();
	}

	// ¼ýÀÚ¸¶ ¹ÝÈ¯
	function only_digt(v1)
	{
		var num ='0123456789';
		var targ = "";

		for(var i=0;i<v1.length;i++){
			//alert(v1.charAt(i));
			if(-1 != num.indexOf(v1.charAt(i))){
				targ += v1.charAt(i);
			}
		}

		return targ;
	}

	// --Áöµµ Ã£±â 
	function go_map(v1,v2){
		//alert(v1);
		//location.href="/hospital/index.jsp?juso1="+v1+"&"+new Date().getTime();

		var form = document.getElementById('hospital_search');
		for(var i=0; i < form.juso1.length; i++)
		{
			if(form.juso1.options[i].value == v1)
			{
				form.juso1.options[i].selected = true;
			}
		}
	}


	function clearField(field)
	{
		if (field.value == field.defaultValue) {
			field.value = "";
		}
	}
	function checkField(field)
	{
		if (!field.value) {
			field.value = field.defaultValue;
		}
	}

	// »ó´ãÀÇ ÀÚ¼¼È÷ º¸±â 
	function open_doctor_view(theURL)
	{
	window.open(theURL,"",'width=630,height=600,resizable,status=no,scrollbars=yes');
	}


