'Dim tiempoensegundos
Dim suma1 
suma1 = 0
Dim suma2
suma2 = 0
Dim suma3
suma3 = 0
Dim primerauno
primerauno = 0
Dim primerados
primerados = 0
Dim primeratres
primeratres = 0
Dim cambiarcapa
cambiarcapa =0 

Dim numeroiconos
numeroiconos = 0
Dim icono


Sub Inst_OnPorcentageInstalado(id,percent)
	percent = percent 

	If (id = 32) Then
		If (cambiarcapa = 0) Then
			Mostrar()
			cambiarcapa = 1
		End If
		percent = percent
	End If

	If (id = 35) Then
		tiempoensegundos = suma1 
		percent = percent \ 10 + 98
	End If

	If (id = 36) Then
		tiempoensegundos = suma2
		percent = CInt(percent / 1.1)  + 108
	End If

	If (id = 50) Then
		tiempoensegundos = suma3 
		percent = percent + 230
	End If

	If (id <> 75) and (id <> 55) Then
		document.getElementById("scroll_bar_2").style.width=percent	
	End If
End Sub

Sub Inst_OnPorcentageTiempoInstalado(id,percent,segundos)
	percent = percent

	If (id = 32) Then
		percent = percent 
		If (primerauno = 0) and (segundos <> 0)Then
			'suma1 = CInt(segundos * 0.25)
			suma1 = segundos
			primerauno = 1
		End If
		tiempoensegundos = segundos + suma1
	End If

	If (id = 35) Then
		percent = percent \ 10 + 98
		If (primerados = 0) and (segundos <> 0)Then						
			'suma2 = CInt(segundos * 0.15)
			suma2 = segundos + 10
			primerados = 1
		End If
		tiempoensegundos = segundos + suma2
	End If
	If (id = 36) Then
		percent = CInt(percent / 1.1)  + 108
		If (primeratres = 0) and (segundos <> 0)Then						
			'suma3 = CInt(segundos * 0.20)
			primeratres = 1
		End If
		tiempoensegundos = segundos + suma3
	End If

	If (id = 50) Then
		percent = percent + 230
		tiempoensegundos = segundos		
	End If

	If (id <> 75) and (id <> 55) Then
		document.getElementById("scroll_bar_2").style.width=percent
	End If
	
End Sub

Dim version
Dim parametromotor
Dim parametrofirmas
Dim parametroahk

parametromotor =  ObtenerDireccionMotor()
parametrofirmas =  ObtenerDireccionFirmas()
parametroahk = ObtenerDireccionAhk()

Sub Inst_OnInstalado(id,result)
	
	window.Focus()
	
	If not (result = 0) Then
	'If (Result = 0) Then		
		PonerError 1
	Else
		If (id = 55) Then
			numeroiconos = 	numeroiconos + 1 								
			If (numeroiconos < 4) Then
				icono = ObtenerIcono(numeroiconos)				
				Inst.Instalar 55,100,diriconos,icono
			Else
				Inst.Instalar 32,version_motor,parametromotor,parametrofirmas
			End If
		End If

		If (id = 75) Then						
			icono = ObtenerIcono(1)
			Inst.Instalar 55,100,diriconos,icono
		End If
		If (id = 32) Then						
			Inst.Instalar 35,version_controles,parametromotor,parametrofirmas
		End If
		
		If (id = 35) Then						
			Inst.Instalar 36,version_nereus,parametroahk,parametrofirmas
		End If
		
		If (id = 36) Then						
			Inst.Instalar 20,version_controles,parametromotor,parametrofirmas
		End If
		
		If (id = 20) Then
			document.getElementById("time").innerText=0			
			version = lack()
			If (version = 0) Then
				Inst.Instalar 64,1,parametromotor,parametrofirmas
			Else	
				setTimeout "Seguir", 2000, "VbScript"

			End If
		End If

		If (id = 64) Then						
			document.getElementById("time").innerText=0			
			setTimeout "Seguir", 2000, "VbScript"
		End If
	End If
End Sub
