private  aitc_edit_idfoc
Sub aitc_edit_onMouseOver(fld,td1)
	Set fld1 = eval("document.all."+fld+"_td")
	aitc_edit_id = fld+"_td"
	if int(td1) = 1 Then 
		Set fld2 = eval("document.all."+fld+"_td1")
		fld1.className = "input_table_border_hover"
		fld2.className = "input_td1_hover"
	elseif int(td1) = 2 Then 
		Set fld2 = eval("document.all."+fld+"_td1")
		Set fld3 = eval("document.all."+fld+"_td2")
		fld1.className = "input_table_border_hover"
		fld2.className = "input_td11_hover"
		fld3.className = "input_td1_hover"
	else fld1.className = "input_table_border_bg_hover"
	End if
End sub

Sub aitc_edit_onMouseOut(fld,td1)
	Set fld1 = eval("document.all."+fld+"_td")
	if fld+"_td" <> aitc_edit_idfoc Then 
		if int(td1) = 1 Then 
			Set fld2 = eval("document.all."+fld+"_td1")
			fld1.className = "input_table_border"
			fld2.className = "input_td1"
		elseif int(td1) = 2 Then 
			Set fld2 = eval("document.all."+fld+"_td1")
			Set fld3 = eval("document.all."+fld+"_td2")
			fld1.className = "input_table_border"
			fld2.className = "input_td11"
			fld3.className = "input_td1"
		else fld1.className = "input_table_border_bg"
		End if
	End if
End sub

Sub aitc_edit_onFocus(fld,td1)
	Set fld1 = eval("document.all."+fld+"_td")
	aitc_edit_idfoc = fld+"_td"
	if int(td1)= 1 Then 
		Set fld2 = eval("document.all."+fld+"_td1")
		fld1.className = "input_table_border_hover"
		fld2.className = "input_td1_hover"
	elseif int(td1)= 2 Then 
		Set fld2 = eval("document.all."+fld+"_td1")
		Set fld3 = eval("document.all."+fld+"_td2")
		fld1.className = "input_table_border_hover"
		fld2.className = "input_td11_hover"
		fld3.className = "input_td1_hover"
	else fld1.className = "input_table_border_bg_hover"
	End if
End sub

Sub aitc_edit_onBlur(fld,td1)
	if aitc_edit_idfoc <> "" Then
		Set fld1 = eval("document.all."+aitc_edit_idfoc)
			if int(td1)= 1 Then 
				Set fld2 = eval("document.all."+fld+"_td1")
				fld1.className = "input_table_border"
				fld2.className = "input_td1"
			elseif int(td1)= 2 Then 
				Set fld2 = eval("document.all."+fld+"_td1")
				Set fld3 = eval("document.all."+fld+"_td2")
				fld1.className = "input_table_border"
				fld2.className = "input_td11"
				fld3.className = "input_td1"
			else fld1.className = "input_table_border_bg"
			End if
		aitc_edit_idfoc = ""
	end if
End sub
function aitc_format_editchange(value1)
	if isnumeric(value1) = True Then
		aitc_format_editchange = formatNumber(value1,-1,-2,-2,-2)
	else aitc_format_editchange = value1
	end if
end function
function aitc_format_hiddchange(value1)
	if isnumeric(value1) = True Then
		a = formatNumber(value1,-1,0,0,0)
		aitc_format_hiddchange = replace(a, ",", ".")
	else aitc_format_editchange = value1
	end if
end function

function aitc_edit_onload_exec(func)
	a = replace(eval("document.all." & func).value, "'", """")
	execute(a)
end function

function aitc_CDbl(aVariant)
	  Dim b, a, b1, a1
	  b = "100000000000000000000"
	  if InstrRev(aVariant, ".") > 0 and InstrRev(aVariant, ".") < len(aVariant) then 
		a = len(aVariant) - InstrRev(aVariant, ".")
		b1 = trim(replace(Cstr(aVariant), ".", ""))
	  elseif InstrRev(aVariant, ",") > 0 and InstrRev(aVariant, ",") < len(aVariant) then 
		a = len(aVariant) - InstrRev(aVariant, ",")
		b1 = trim(replace(Cstr(aVariant), ",", ""))
	  else 
		b1 = aVariant	
		a = 0
	  end if
	  a1 = int(left(b,a+1))
	if isnumeric(b1) Then 
		aitc_CDbl = int(b1) / a1
	else aitc_CDbl = b1
	end if
end function


