var chkUrl = document.location.href;
function showmeRi() 
	{
		document.all.idRi.style.display = "";
		document.all.idRi2.style.display = "";
	}

function hidemeRi() 
	{
		document.all.idRi.style.display = "none";
		document.all.idRi2.style.display = "none";
	}

function F_Sigugun(sido)
	{			
		var int_sigugun = document.frmSearch.resSiGuGun.length;				
		var int_EMDong = document.frmSearch.resEMDong.length;
		for (i=1;i<=int_sigugun;i++)
			{			
				document.frmSearch.resSiGuGun.options[1] = null;			
			}						
		for (i=1;i<=int_EMDong;i++)
			{
				document.frmSearch.resEMDong.options[1]= null;
			}
		Sigugun(sido);	
		
		if (chkUrl.indexOf("/sojae_search.asp") != -1 || chkUrl.indexOf("/GongMae_search.asp") != -1)
			{ 
				if (sido != '09')
					{
						showmeRi();
					}
				if (sido == '09')
					{
						hidemeRi();
					}
			}
	}
	
function Set_Sigugun(sigugun)
	{			
		for(i=1;i<sigugun.length;i++)
			{
				document.frmSearch.resSiGuGun.options[i] = new Option(sigugun[i]);				
				document.frmSearch.resSiGuGun.options[i].value = sigugun[i];
			}
	}
		
function F_EMDong(sido,sigugun)
	{							
		var int_EMDong = document.frmSearch.resEMDong.length;						
		for (i=1;i<=int_EMDong;i++)
			{
				document.frmSearch.resEMDong.options[1] = null;
			}
		if (sigugun.indexOf(" ") > 0)
			{
				emp = sigugun.split(" ");	
				sigugun = emp[0]+emp[1];
			}
		//alert(sigugun);
		EMDong(sido,sigugun);	
	}
		
function Set_EMDong(EMDong)
	{
		for (i=1;i<EMDong.length;i++)
			{
				document.frmSearch.resEMDong.options[i] = new Option(EMDong[i]);
				document.frmSearch.resEMDong.options[i].value = EMDong[i];
			}
	}
	
function popDocument(f1,f2,f3) // PDFÀüÀÚ½Å¹® º¸±â
	{
		mini = window.open("/common/pdf_Url.asp?LayerType=" + f1 + "&ImageUrl=" + f2 + "&bubcd=" + f3,'pop','left=10,top=10,width=900,height=700,marginwidth=0,marginheight=0,menubar=0,scrollbars=1,resizable=1');
	}

function paper_chk(funcBubwonCode,funcStartDate,funcBubwonJuso)   // 
	{
		document.frmPaper.resBubwonCode.value=funcBubwonCode;
		document.frmPaper.resStartDate.value=funcStartDate;
		if (chkUrl.indexOf("/vod/") != -1 || chkUrl.indexOf("/OnlineNet/") != -1)
			document.frmPaper.resBubName.value = funcBubwonJuso;
		else
			document.frmPaper.resBubwonJuso.value=funcBubwonJuso;
		return true;
	}

function frmValidate(f1,f2,f3) // frmRegist Validate
	{	
		var msg = f2;
		switch (f3)    
			{	
				case "select"   : msg += "¼±ÅÃÇÏ¿© ÁÖ½Ê½Ã¿À"; break;        
				case "checkbox" : msg += "Ã¼Å©ÇÏ¿© ÁÖ½Ê½Ã¿À"; break;
				default         : msg += "ÀÔ·ÂÇÏ¿© ÁÖ½Ê½Ã¿À";    
			}   
		if (!f1.value)    
			{        
				alert(msg)
				f1.focus();        
				return true;    
			}
	}

function GGPopup(url,name,width,height,top,left,titlebar,toolbar,menubar,statusbar,scrollbar,resizable)
	{	
	    var toolbar_str,menubar_str,statusbar_str,titlebar_str,scrollbar_str,resizable_str;
	    titlebar_str	= titlebar  ? "yes" : "no";
	    toolbar_str		= toolbar   ? "yes" : "no";
	    menubar_str		= menubar   ? "yes" : "no";
	    statusbar_str	= statusbar ? "yes" : "no";
	    scrollbar_str	= scrollbar ? "yes" : "no";
	    resizable_str	= resizable ? "yes" : "no";
		window.open (url,name,'left='+left+',top='+top+',width='+width+',height='+height+',titlebar='+titlebar_str+',toolbar='+toolbar_str+',menubar='+menubar_str+',status='+statusbar_str+',scrollbars='+scrollbar_str+',resizable='+resizable_str);
		if (navigator.appName == 'Netscape')
			wnd.focus();
	} 		


function JuminNoValidate(f1,f2)
	{
		var check = 0;
		for (var i = 2; i <= 7 ; i++)
			{ 
				check = check + (i * parseInt(f1.value.substring(i-2,i-1)))
			}
	
		for (var i = 6; i <= 11 ; i++)
			{ 
		       check = check + ((i % 8 + 2) * parseInt(f2.value.substring(i-6,i-5)))
			}
	
		check = 11 - (check % 11)
		check = check % 10
		if (check != f2.value.substring(6,7))
			{
				alert ("Àß¸øµÈ ÁÖ¹Îµî·Ï ¹øÈ£ÀÔ´Ï´Ù.\n\n ´Ù½ÃÀÔ·ÂÇÏ¼¼¿ä!");
				f1.value = "" ;
				f2.value = "" ;
				f1.focus();
				return false ;
			}
	}

function SaupNoValidate(f1,f2,f3)
	{
		
		var xy = 5 * f3.value.substring(3,4);
		if (xy < 10)
			{
				x = 0;
				y = xy;
			}
		else
			{
				y = xy % 10;
				x = parseInt(xy / 10);
			}
		var a = f1.value.substring(0,1);
		var b = f1.value.substring(1,2);
		var c = f1.value.substring(2,3);
		var d = f2.value.substring(0,1);
		var e = f2.value.substring(1,2);
		var f = f3.value.substring(0,1);
		var g = f3.value.substring(1,2);
		var h = f3.value.substring(2,3);
		var i = f3.value.substring(3,4);
		var j = f3.value.substring(4,5);
		var mn = (parseInt(x) + parseInt(y) + parseInt(a) + parseInt(d) + parseInt(g)) + ((parseInt(b) + parseInt(e) + parseInt(h)) * 3) + ((parseInt(c) + parseInt(f)) * 7);
		if (mn < 10)
			{
				m = 0;
				n = mn;
			}
		else
			{
				m = mn / 10;
				n = mn % 10;
			}
		k = (10 - parseInt(n)) % 10

		if ( j != (10 - parseInt(n)) % 10 )
			{
				alert('»ç¾÷ÀÚ µî·Ï ¹øÈ£°¡ Àß¸øµÇ¾ú½À´Ï´Ù.\n\n´Ù½Ã ÀÔ·ÂÇÏ½Ê½Ã¿ä!');  
				f1.value = ''
				f2.value = ''
				f3.value = ''
				f1.focus();
				return false;
			}	
	}

function makeNumber(f1)
	{
		alert(f1)
		return f1.replace(/,/gi,"");
	}	
	
function makeMoney(f1)  
	{
		alert(f1)
		var str;
		if (isNaN(f1))
			str = f1;
		else
			str = FormatNumber(f1,0);
			
		return str;
	}

function FormatNumber(num,num2)  // vbscript FormatNumberÇÔ¼ö ´ëÃ¼¿ë
	{
		alert(num)
		var strNumber = ""
		var price = String(num);   
		for (var i = 1; i <= price.length; i++)  
			{
				if (i % 3)	strNumber = price.charAt(price.length - i) + strNumber;
				else 		strNumber = "," + price.charAt(price.length - i) + strNumber;  // 3À¸·Î ³ª´²Áö´Â °÷
				
			}
	
		return strNumber.replace(/^,/,"");
	}