blanc = Color.new(255,255,255)
select = 1

while true do
screen:clear()
pad=Controls.read()

screen:blit(0,0,menu)
  if System.powerIsBatteryExist() then exist = "1" else exist = "0" end
  if System.powerGetBatteryLifePercent() >= 0 then batteryL = bat01 end
  if System.powerGetBatteryLifePercent() > 10 then batteryL = bat02 end
  if System.powerGetBatteryLifePercent() > 40 then batteryL = bat03 end
  if System.powerGetBatteryLifePercent() > 75 then batteryL = bat04 end
if select == 1 then
screen:clear()
screen:blit(0,0,menu)
screen:blit(130,100,fleche)
if exist == "1" then
screen:blit(452,1,batteryL)
if System.powerIsPowerOnline() then
screen:blit(420,1,Image.load("Images/charge.png"))
end
end
if exist == "0" then
screen:blit(448,1,Image.load("Images/charge.png"))
end
end

if select == 2 then
screen:clear()
screen:blit(0,0,menu)
screen:blit(130,129,fleche)
if exist == "1" then
screen:blit(452,1,batteryL)
if System.powerIsPowerOnline() then
screen:blit(420,1,Image.load("Images/charge.png"))
end
end
if exist == "0" then
screen:blit(448,1,Image.load("Images/charge.png"))
end
end

if select == 3 then
screen:clear()
screen:blit(0,0,menu)
screen:blit(130,158,fleche)
if exist == "1" then
screen:blit(452,1,batteryL)
if System.powerIsPowerOnline() then
screen:blit(420,1,Image.load("Images/charge.png"))
end
end
if exist == "0" then
screen:blit(448,1,Image.load("Images/charge.png"))
end
end

if select == 4 then
screen:clear()
screen:blit(0,0,menu)
screen:blit(130,187,fleche)
if exist == "1" then
screen:blit(452,1,batteryL)
if System.powerIsPowerOnline() then
screen:blit(420,1,Image.load("Images/charge.png"))
end
end
if exist == "0" then
screen:blit(448,1,Image.load("Images/charge.png"))
end
end

if pad:down() then
select = select + 1
end

if pad:up() then
select = select - 1
end

if select == 5 then
select = 1
end

if select == 0 then
select = 4
end

if pad:cross() then

if select == 1 then
screen.flip()
screen.waitVblankStart(7) 
dofile("recherche.lua")
end

if select == 2 then
screen.flip()
screen.waitVblankStart(7) 
dofile("about.lua")
end

if select == 3 then
screen.flip()
screen.waitVblankStart(7) 
dofile("option.lua")
end

if select == 4 then
System.Quit()
end

end


screen.flip()
screen.waitVblankStart(7) 
end
