os.pullEvent = os.pullEventRaw
shell.run("/Laby/Desktop")
term.setTextColor(colors.white)
term.setBackgroundColor(512)
sleep(0)
term.setCursorPos(1,19)
term.setBackgroundColor(colors.green)
write(" Menu ")
term.setBackgroundColor(colors.blue)
write("                                              ")
term.setBackgroundColor(colors.blue)


function Zeit()
         pzeit = os.time()
	     pzeit = textutils.formatTime(pzeit, true)
	return pzeit	 
end



while true do    
      term.setCursorPos(46,19)
      write(""..Zeit())
	  write(" ")
	  sleep(0.1)
break
end	



sleep(0.1)
term.setCursorPos(1,1)
term.setTextColor(colors.white)
term.setBackgroundColor(colors.blue)
write("                 Internet Browser                 ")
term.setBackgroundColor(colors.red)
write("X")
term.setBackgroundColor(colors.white)
term.setTextColor(colors.black)
print("                                                   ")
print("    Downloads:                                     ")
print("    X Skype                                        ")
print("    X LabyWord                                     ")
print("    X LabyOS Update                                ")
write("    X Taschenrechner                                             ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")
print("                                                   ")

term.setCursorPos(1,2)
term.setBackgroundColor(colors.white)
term.setTextColor(colors.black)






while true do
local event, button, X, Y = os.pullEvent("mouse_click")
XY = X..","..Y

if XY == "2,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "3,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "4,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "5,19" and button == 1 then
shell.run("/Laby/start")
break
end

if XY == "51,1" and button == 1 then
term.setTextColor(colors.white)
shell.run("/Laby/gast")
break
end




if XY == "5,3" and button == 1 then
 if fs.exists("/Laby/Downloads/Skype") then
term.setCursorPos(1,9)
print("    Skype ist bereits installiert.")
sleep(2)
shell.run("/Laby/Internet")
else
fs.copy("/Laby/Inet/Skype", "/Laby/Downloads/Skype")
term.setCursorPos(1,9)
write("    Downloading Skype..")
sleep(3)
term.setTextColor(colors.white)
shell.run("/Laby/Download")
end
break
end




if XY == "5,4" and button == 1 then
 if fs.exists("/Laby/Downloads/Word") then
term.setCursorPos(1,9)
print("    LabyWord ist bereits installiert.")
sleep(2)
shell.run("/Laby/Internet")
else
fs.copy("/Laby/Inet/Word", "/Laby/Downloads/Word")
term.setCursorPos(1,9)
write("    Downloading LabyWord..")
sleep(3)
term.setTextColor(colors.white)
shell.run("/Laby/Download")
end
break
end



if XY == "5,6" and button == 1 then
 if fs.exists("/Laby/Downloads/calc") then
term.setCursorPos(1,9)
print("    Der Taschenrechner ist bereits installiert.")
sleep(2)
shell.run("/Laby/Internet")
else
fs.copy("/Laby/Inet/calc", "/Laby/Downloads/calc")
term.setCursorPos(1,9)
write("    Downloading Taschenrechner")
sleep(3)
term.setTextColor(colors.white)
shell.run("/Laby/Download")
end
break
end










if XY == "5,5" and button == 1 then

term.setTextColor(colors.black)
term.setCursorPos(5,9)

print("LabyOS wird neu Installiert...")
sleep(1)
shell.run("Laby/Inet/Update")

break
end
end