function MM_preloadImages() { //v3.0
  var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
    var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
    if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}

function MM_swapImgRestore() { //v3.0
  var i,x,a=document.MM_sr; for(i=0;a&&i<a.length&&(x=a[i])&&x.oSrc;i++) x.src=x.oSrc;
}

function MM_findObj(n, d) { //v3.0
  var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
    d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document); return x;
}

function MM_swapImage() { //v3.0
  var i,j=0,x,a=MM_swapImage.arguments; document.MM_sr=new Array; for(i=0;i<(a.length-2);i+=3)
   if ((x=MM_findObj(a[i]))!=null){document.MM_sr[j++]=x; if(!x.oSrc) x.oSrc=x.src; x.src=a[i+2];}
}

function MM_showHideLayers() { //v3.0
  var i,p,v,obj,args=MM_showHideLayers.arguments;
  for (i=0; i<(args.length-2); i+=3) if ((obj=MM_findObj(args[i]))!=null) { v=args[i+2];
    if (obj.style) { obj=obj.style; v=(v=='show')?'visible':(v='hide')?'hidden':v; }
    obj.visibility=v; }
}

function MM_openBrWindow(theURL,winName,features) { //v2.0
  window.open(theURL,winName,features);
}

function gotop() {
	window.scroll(0,0);
}

function zipcodewin() {
	window.open("/common/zipcode/search.asp","zipcodewin","width=400,height=500");
}

function idchk() {
	window.open("/member/regist/idchk.asp","idchk","width=350,height=250");
}

function namechk() {
	window.open("/member/regist/namechk.asp","namechk","width=450,height=320");
}


function settleinfo() {
	window.open("/member/memberinfo/settleinfo.asp","idchk","width=516,height=540,scrollbars");
}

var ts_selection;
		
function totalsearch(form, sel, ctl) {

	bgimg = document.all.item(ctl).style.backgroundImage;
	img = bgimg.substring(23, bgimg.length);
	img = img.substring(0, img.length-1);

	var objFrm = document.getElementById(form);
	var objSel = document.getElementById(sel);

	if(img == "")
	{
		// Ãß°¡ ( 2008.05.14 ³²Á¤¼® ) - »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ °Ë»ö¾î¿¡ ´ëÇÑ È®ÀÎÀ» À§ÇÑ Á¶°Ç¹®
		if(document.all.item(ctl).value.search("'") != -1)
		{
			alert("ÀÔ·ÂÇÏ½Å °Ë»ö¾îÁß Àß¸øµÈ ¹®ÀÚ°¡ Æ÷ÇÔµÇ¾î ÀÖ½À´Ï´Ù.\n´Ù½Ã ÀÔ·ÂÇØ ÁÖ¼¼¿ä.");
			document.all.item(ctl).value = "";
			document.all.item(ctl).focus();
			return false;
		}
		// Ãß°¡ ( 2008.05.14 ³²Á¤¼® ) - »ç¿ëÀÚ°¡ ÀÔ·ÂÇÑ °Ë»ö¾î¿¡ ´ëÇÑ È®ÀÎÀ» À§ÇÑ Á¶°Ç¹®
		else if(document.all.item(ctl).value == "")
		{
			alert("°Ë»ö¾î¸¦ ÀÔ·ÂÇØÁÖ½Ã±â ¹Ù¶ø´Ï´Ù");
			document.all.item(ctl).focus();
			return false;
		}
		else if(document.all.item(ctl).value.length < 2){
			alert("µÎ ±ÛÀÚ ÀÌ»óÀÇ °Ë»ö¾î¸¦ ³Ö¾î ÁÖ½Ã±â ¹Ù¶ø´Ï´Ù");
			document.all.item(ctl).focus();
			return false;
		}
		else
		{
			switch(objSel.value)
			{
				case 'search_total':
					objFrm.SearchType.value = "TOTAL";
					objFrm.SearchOption.value = "search_total";
					objFrm.SearchKeyWord.value = document.all.item(ctl).value;					
					break;
				case 'search_product':
					objFrm.SearchType.value = "NORMAL";
					objFrm.SearchOption.value = "search_product";
					objFrm.productname.value = document.all.item(ctl).value;					
					break;
				case 'search_generic':
					objFrm.SearchType.value = "NORMAL";
					objFrm.SearchOption.value = "search_generic";
					objFrm.generic.value = document.all.item(ctl).value;					
					break;
				case 'search_distname':
					objFrm.SearchType.value = "NORMAL";
					objFrm.SearchOption.value = "search_distname";
					objFrm.manufacturer.value = document.all.item(ctl).value;					
					break;
				case 'search_insurance':
					objFrm.SearchType.value = "NORMAL";
					objFrm.SearchOption.value = "search_insurance";
					objFrm.insurance.value = document.all.item(ctl).value;					
					break;	
			}
		
			objFrm.submit();
		}
	}
	else if( img == "bnnr_orodipine.gif" )
	{
		objFrm.SearchType.value = "TOTAL";
		objFrm.SearchOption.value = "search_total";
		objFrm.SearchKeyWord.value = "¿À·ÎµðÇÉ";
		objFrm.submit();
	}
	else if( img == "logo_stillen.gif" || img == "logo_stillen02.gif" )
	{
		objFrm.SearchType.value = "TOTAL";
		objFrm.SearchOption.value = "search_total";
		objFrm.SearchKeyWord.value = "½ºÆ¼·»";
		objFrm.submit();
	}
	else if( img == "search_Glimel_l.gif" || img == "search_Glimel_s.gif" )
	{
		objFrm.SearchType.value = "TOTAL";
		objFrm.SearchOption.value = "search_total";
		objFrm.SearchKeyWord.value = "±Û¸®¸á";
		objFrm.submit();
	}
	else if( img == "search_exporge.gif" || img == "search_exporge.gif" )
	{
		objFrm.SearchType.value = "TOTAL";
		objFrm.SearchOption.value = "search_total";
		objFrm.SearchKeyWord.value = "¿¢½ºÆ÷Áö";
		objFrm.submit();
	}
	else
	{
	}
	
}

//°Ë»ö¾î ÀÔ·Â½Ã ¹è°æÀÌ¹ÌÁö »èÁ¦ (2005.06.30 ³²Á¤¼® Ãß°¡)
function ch (ctl) {
	if ( event.type == "keydown" && event.keyCode == 13 ) return true;
	document.all.item(ctl).style.backgroundImage="";

	return true;
}
//ÀÌ¹ÌÁö »èÁ¦ ³¡

function change() {

	selsrh.selectedIndex
	

}


//-------------------- ', &, <, >, ", °ø¹é ºÒ°¡ ÇÔ¼ö
	function no_character(str) {					
		for(i=0;i<str.value.length;i++) {
			if(str.value.charCodeAt(i)==39) {
				alert("¿©±â¿¡ '(ÀÛÀºµû¿ÈÇ¥)´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
				str.value="";
				str.focus();
				return;
				}
			if(str.value.charCodeAt(i)==38) {
				alert("¿©±â¿¡ &´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
				str.value="";
				t.focus();
				return;
				}
			if(str.value.charCodeAt(i)==60) {
				alert("¿©±â¿¡ '<'´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
				str.value="";
				str.focus();
				return;
				}
			if(str.value.charCodeAt(i)==62) {
				alert("¿©±â¿¡ '>'´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.");
				t.value="";
				t.focus();
				return;
				}
			if(str.value.charCodeAt(i)==34) {
				alert('¿©±â¿¡ "(Å« µû¿ÈÇ¥)´Â »ç¿ëÇÏ½Ç ¼ö ¾ø½À´Ï´Ù.');
				str.value="";
				str.focus();
				return;
				}
			}

		}



//------------------ ¼ýÀÚ¸¸ ¹Þ¾ÆµéÀÌ´Â  ÇÔ¼ö ---------------
	function onlynumber(str) {
		var i;	
		for(i=0;i<=str.value.length;i++) {			//¹®ÀÚ¿­ ¼ö¸¸Å­ ¹Ýº¹.
						//¼ýÀÚ°¡ ¾Æ´Ñ °ÍÀÌ ÀÖÀ¸¸é
			if(str.value.charCodeAt(i) < 48 || str.value.charCodeAt(i) > 57) 	{	 
//				num=false;		
				alert("¼ýÀÚ·Î ÀÔ·ÂÇØÁÖ¼¼¿ä.");
				str.value="";
				str.focus();
				return;
				}
			}
		}
//------------------  ÇÁ¸°ÅÍÁ¦¾î ÇÔ¼ö ---------------
	function printDruginfo() {
		factory.printing.header = ""
		factory.printing.footer = ""
		factory.printing.portrait = true
		factory.printing.leftMargin = 30.0
		factory.printing.topMargin = 30.0
		factory.printing.rightMargin = 30.0
		factory.printing.bottomMargin = 30.0
		factory.printing.Print(false, window)
	}
//------------------  ¼³¹®Á¶»ç Ã¼Å©ÇÔ¼ö --------------- 2004.3.30 ±èÁö¿¬

//------------------  Äá³ª¹° Áöµµ¼­ºñ½º --------------- 2004.10.28 ±èÁö¿¬
function viewMap(){	
	//var aw = screen.availwidth-10;
	//var ah = screen.availheight-28;
	var aw = 800;
	var ah = 600;
	var openUrl = "http://medical.congnamul.com/MedicalMap/view/map.jsp?SIMPLEJOIN=21";	
	mapWindow = window.open(openUrl, "MedicalMapBrowser", "toolbar=no,location=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=yes,width="+aw+",height="+ah+",top=0,left=0");
}

//------------------  Á¢¾ú´Ù Æñ´ÙÇÏ±â --------------- 2007.01.31 ±èÁö¿¬
function dis_ins(obname,obname2)
{
	obname.style.display = "none";
	obname2.style.display = "none";
}

function dis_p(obname,obname2)
{
	if (obname.style.display == "block")
	{
		obname.style.display = "none";
		obname2.style.display = "none";
	}
	else
	{
		obname.style.display = "block";
		obname2.style.display = "block";
	}
}