
'if document.location.pathname = top.location.pathname then 
''alert(window.name)
'	if ( (ucase(window.name) <> "CODEFIND") and (ucase(window.name) <> "_UPLOADWIN")  and (ucase(window.name) <> "POST") ) THEN 
'		if tyWindow <> "modal" then top.location = "/exc/"
'	end if
'end if

	Sub sbSetLogoRun(pData)
'		if pData = "S" then 
'		sbSetLogo("S")	
'		else
'			sbSetLogo("E")	
'	end if 
	End Sub 
	
	function fnSetSaveData(pFlag , pArr)
		Dim i 
		Dim strData
		strData = strData & pFlag & "|" & chr(9)
		for i = 0 to UBound(pArr, 1)
'			if i <> UBound(pArr, 1) then
				strData = strData & pArr(i) & "|" & chr(9) 
'			else 
'				strData = strData & pArr(i)
'			end if 
		next
		strData = strData & "|" & chr(13) 
		
		fnSetSaveData = strData
	
	End function 
	
	function fnSetSearchData(pArr)
		Dim i 
		for i = 0 to UBound(pArr, 1)
			if i <> UBound(pArr, 1) then
				strData = strData & pArr(i) & "|" & chr(9) 
			else 
				strData = strData & pArr(i)
			end if 
		next
		
		fnSetSearchData = strData
	
	End function
	

	Sub sbRemoveData(pForm)
		Dim i

		for i = 0 to pForm.Length-1
			if pForm.item(i).tagname = "INPUT" then 
				pForm.item(i).Value= ""
			end if 
		Next
	End Sub 
 
 	Sub sbSetReadOnly(pForm, pFlag)
		Dim i 
		
		if pFlag = "T" then 
			for i = 0 to pForm.Length-1
				if pForm.item(i).tagname = "BUTTON" then
					pForm.item(i).style.display = "none"
				elseif pForm.item(i).tagname = "INPUT"  then
					if pForm.item(i).type = "radio" Then
						pForm.item(i).disabled = True
					else						
						pForm.item(i).readonly = True
					end if	
				elseif pForm.item(i).tagname = "TEXTAREA"  then
					pForm.item(i).readonly = True
				end if 								
			Next	
		elseif pFlag = "F" then  
			for i = 0 to pForm.Length-1
				if pForm.item(i).tagname = "BUTTON" then
					pForm.item(i).style.display = "inline"					
				elseif pForm.item(i).tagname = "INPUT" then
					if pForm.item(i).type = "radio" Then
						pForm.item(i).disabled = False
					else						
						pForm.item(i).readonly = False
					end if	
				elseif pForm.item(i).tagname = "TEXTAREA"  then
					pForm.item(i).readonly = False
				end if 								
			Next	
		end if 
	End Sub 
	
	
	
	Sub sbSetbutton(pData)
		Select Case pData 
			Case "INSERT" 
					btnNew.style.display = "none"
					btnEdit.style.display = "none"
					btnDelete.style.display = "none"
					btnSave.style.display = "inline"
					btnCancel.style.display = "inline"
					btnList.style.display = "inline"				
			Case "UPDATE"
					btnNew.style.display = "none"
					btnEdit.style.display = "none"
					btnDelete.style.display = "none"
					btnSave.style.display = "inline"
					btnCancel.style.display = "inline"
					btnList.style.display = "inline"				
			Case "QUERY"
					btnNew.style.display = "inline"
					btnEdit.style.display = "inline"
					btnDelete.style.display = "inline"
					btnSave.style.display = "none"
					btnCancel.style.display = "none"
					btnList.style.display = "inline"				
		End Select 
	
	End Sub
	
	
	Sub sbSetbuttonRegistIssue(pData)
		Select Case pData 
			Case "INSERT" 
					btnIssueRequest.style.display = "none"
					btnEdit.style.display = "none"
					btnDelete.style.display = "none"
					btnSave.style.display = "inline"
					btnCancel.style.display = "inline"
					btnList.style.display = "inline"				
			Case "UPDATE"
					btnIssueRequest.style.display = "none"
					btnEdit.style.display = "none"
					btnDelete.style.display = "none"
					btnSave.style.display = "inline"
					btnCancel.style.display = "inline"
					btnList.style.display = "inline"				
			Case "QUERY"
					btnIssueRequest.style.display = "inline"
					btnEdit.style.display = "inline"
					btnDelete.style.display = "inline"
					btnSave.style.display = "none"
					btnCancel.style.display = "none"
					btnList.style.display = "inline"				
		End Select 
	
	End Sub
	
	
	// Ã³À½ È­¸éÀÌ ¶ã ¶§ 
	Sub sbCheckForm(pData)
		if pData = "START" then 
		
		elseif pData = "END" then 
	
		end if 
	End Sub 
	
	// New button Click ½Ã °øÅë ÀÛ¾÷ÇÒ ¶§ 
	function fnChkNew()
		fnChkNew = true	
	end function 

	// Edit button Click ½Ã °øÅë ÀÛ¾÷ÇÒ ¶§ 	
	function fnChkEdit()
		fnChkEdit = true
	
	end function 
	
	// Delete button Click ½Ã °øÅë ÀÛ¾÷ÇÒ ¶§ 		
	function fnChkDelete()
		fnChkDelete = true
	
	end function 

	// Save button Click ½Ã °øÅë ÀÛ¾÷ÇÒ ¶§ 		
	function fnChkSave()
		fnChkSave = true
	
	end function 			
	
	Sub sbSetImageOver(pImgObj)

		pImgObj.style.cursor = "hand"
		
		If  Mid(pImgObj.src,InStrRev(pImgObj.src,".")-1,1) = "X" then 
			Exit Sub
		End If 
		
		Dim ImgNewSrc
		ImgNewSrc = mid(pImgObj.src, 1, InStrRev(pImgObj.src,"/")) & pImgObj.Name & "S" & Mid(pImgObj.src,InStrRev(pImgObj.src,".") )
		pImgObj.src = ImgNewSrc
	End Sub
	
	// Image Out 
	Sub sbSetImageOut(pImgObj)
		
		pImgObj.style.cursor = "default"
		
		If  Mid(pImgObj.src,InStrRev(pImgObj.src,".")-1,1) = "X" then 
			Exit Sub
		End If 
		
		Dim ImgNewSrc
		ImgNewSrc = mid(pImgObj.src, 1, InStrRev(pImgObj.src,"/")) & pImgObj.Name & "O" & Mid(pImgObj.src,InStrRev(pImgObj.src,".") )
		pImgObj.src = ImgNewSrc
	End Sub 
	
	// Image Down
	Sub sbSetImageDown(pImgObj)
		pImgObj.style.cursor = "hand"
		
		If  Mid(pImgObj.src,InStrRev(pImgObj.src,".")-1,1) = "X" then 
			Exit Sub
		End If 
		
		Dim ImgNewSrc
		ImgNewSrc = mid(pImgObj.src, 1, InStrRev(pImgObj.src,"/")) & pImgObj.Name & "D" & Mid(pImgObj.src,InStrRev(pImgObj.src,".") )
		pImgObj.src = ImgNewSrc
	End Sub 

	
	
	
	// Image Disabled
	Sub sbSetImageDisabled(pImgObj)
		pImgObj.style.cursor = "default"
	end Sub	
		 
		

	// ¿ìÆí¹øÈ£
// 	Sub sbZipClick(pData)
	// pData = Call ÇÏ´Â ´ë»ó
//		Window.Open "../../../cz/inc/Post/cze_Post.asp?Object=" & pData, "Post", _ 
//						"resizable=No, scrollbars=Yes, toolbar=no, status = no,width= 570 height=330"
//	end sub
////////////////////////////////////////////////////////////////////////////////////
		Function gblnHangulAmt(dblAmt) 
			Dim bb          
			Dim cc          
			Dim strChr(9)  
			Dim strText(12)
			Dim i

			strChr(0) = ""
			strChr(1) = "ÀÏ"
			strChr(2) = "ÀÌ"
			strChr(3) = "»ï"
			strChr(4) = "»ç"
			strChr(5) = "¿À"
			strChr(6) = "À°"
			strChr(7) = "Ä¥"
			strChr(8) = "ÆÈ"
			strChr(9) = "±¸"

			For i = 1 To 12
				strText(i) = ""
			Next

			IF dblAmt = "" THEN
			Exit Function
			ELSE
				bb = dblAmt
			END IF

			cc = Len(Trim(CStr(bb)))

			If (cc - 11) > 0 Then If CCUR(Mid(CStr(bb), (cc - 11), 1)) > 0 Then strText(1) = strChr(CCUR(Mid(CStr(bb), (cc - 11), 1))) & "Ãµ "
			If (cc - 10) > 0 Then If CCUR(Mid(CStr(bb), (cc - 10), 1)) > 0 Then strText(2) = strChr(CCUR(Mid(CStr(bb), (cc - 10), 1))) & "¹é "
			If (cc - 9) > 0 Then If CCUR(Mid(CStr(bb), (cc - 9), 1)) > 0 Then strText(3) = strChr(CCUR(Mid(CStr(bb), cc - 9, 1))) + "½Ê "
			If (cc - 8) > 0 Then If CCUR(Mid(CStr(bb), (cc - 8), 1)) > 0 Then strText(4) = strChr(CCUR(Mid(CStr(bb), (cc - 8), 1))) + "¾ï " Else strText(4) = "¾ï "
			If (cc - 7) > 0 Then If CCUR(Mid(CStr(bb), (cc - 7), 1)) > 0 Then strText(5) = strChr(CCUR(Mid(CStr(bb), (cc - 7), 1))) + "Ãµ "
			If (cc - 6) > 0 Then If CCUR(Mid(CStr(bb), (cc - 6), 1)) > 0 Then strText(6) = strChr(CCUR(Mid(CStr(bb), (cc - 6), 1))) + "¹é "
			If (cc - 5) > 0 Then If CCUR(Mid(CStr(bb), (cc - 5), 1)) > 0 Then strText(7) = strChr(CCUR(Mid(CStr(bb), (cc - 5), 1))) + "½Ê "
			If (cc - 4) > 0 Then 
				If CCUR(Mid(CStr(bb), (cc - 4), 1)) > 0 Then 
					strText(8) = strChr(CCUR(Mid(CStr(bb), (cc - 4), 1))) + "¸¸ " 
				Else 
					If strText(5) <> "" or strText(6) <> "" or strText(7) <> "" then 
						strText(8) = "¸¸ " 
					end if
				end if
			end if
			If (cc - 3) > 0 Then If CCUR(Mid(CStr(bb), (cc - 3), 1)) > 0 Then strText(9) = strChr(CCUR(Mid(CStr(bb), (cc - 3), 1))) + "Ãµ "
			If (cc - 2) > 0 Then If CCUR(Mid(CStr(bb), (cc - 2), 1)) > 0 Then strText(10) = strChr(CCUR(Mid(CStr(bb), (cc - 2), 1))) + "¹é "
			If (cc - 1) > 0 Then If CCUR(Mid(CStr(bb), (cc - 1), 1)) > 0 Then strText(11) = strChr(CCUR(Mid(CStr(bb), (cc - 1), 1))) + "½Ê "
			If cc > 0 Then If CCUR(Mid(CStr(bb), cc, 1)) > 0 Then strText(12) = strChr(CCUR(Mid(CStr(bb), cc, 1)))

			gblnHangulAmt = strText(1) + strText(2) + strText(3) + strText(4) + strText(5) + strText(6) + strText(7) + strText(8) + strText(9) + strText(10) + strText(11) + strText(12)

		End Function

		function getString( pString, pLevel )
			select case pLevel
				case "7"
					getString = left(pString, 13)
				case "6"
					getString = left(pString, 10)
				case "5"
					getString = left(pString, 7)
				case "4"
					getString = left(pString, 5)
				case "3"
					getString = left(pString, 3)
				case "2"
					getString = left(pString, 2)
				case "1"
					getString = left(pString, 1)
			end select
		end function

	Sub sbMenuonload()
	'	Set objClickMenu = imglogo	
	'	Set objSubMenu  = imglogo	
	End Sub 


function ValidPatrn(Patrnid, pString)

  Dim ObjRegExp
  Dim Patrn

    Select case Patrnid
           
           case "CellPhone"
             Patrn  = "^01[0-9]-(?:\d{3}|\d{4})-\d{4}$"
           case "Phone"
              Patrn  ="^0(?:\d{1}|\d{2})-(?:\d{3}|\d{4})-\d{4}$"  
           case "E-Mail"
              Patrn = "^([0-9a-zA-Z_-]+)@([0-9a-zA-Z_-]+)(\.[0-9a-zA-Z_-]+){1,2}$"
           case "ZipCode"
              Patrn = "^\d{3}-\d{3}" 
           case "Jumin"
              Patrn ="\d{6}-[1-4]\d{6}"
           case "Date"
            Patrn ="^\d{4}-\d{2}-\d{2}$" 
    
    End Select

   

    
  On Error Resume Next    
    
    Set ObjRegExp = New RegExp
    
    ObjRegExp.Pattern = Patrn               '** Á¤±Ô Ç¥Çö½Ä ÆÐÅÏ
    ObjRegExp.IgnoreCase = True             '** ´ë.¼Ò¹®ÀÚ ±¸ºÐ ¾ÈÇÔ
    
    ValidPatrn = ObjRegExp.Test(pString)
    
    Set ObjRegExp = Nothing


End Function
