Script = SystemPath("ScriptPath") \ SystemPath("ScriptName") & SystemPath("ScriptExt")
RemoveNotifications(Script)

i = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "Day")

If ( i > 0 )
   T = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "Time")
   If ( T+10 < TimeStamp() )
      i = -1
   EndIf
EndIf

i = i + 1
If ( RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "날씨") eq "" )
   i = i + 1
   If ( RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "날씨") eq "" )
      i = i + 1
   EndIf
EndIf
If ( i > 2 )
   i = 0
EndIf

          Week1[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "요일(w)")
          Week2[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "요일")
        MaxTemp[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "최고기온")
        MinTemp[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "최저기온")
       Forecast[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "날씨")
  ImageFileName[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "날씨이미지")
DNImageFileName[i] = RegRead("HKLM", "Software\Samsung\MobileWidget\ScriptWeather", "Day" & i & "날씨이미지(DN)")

RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "요일(w)", Week1[i])
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "요일", Week2[i])
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "최고기온", MaxTemp[i])
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "최저기온", MinTemp[i])
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "날씨", Forecast[i])
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "날씨이미지", ImageFileName[i])
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "날씨이미지(DN)", DNImageFileName[i])

RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "Day", i)
RegWriteString("HKLM", "Software\Samsung\MobileWidget\ScriptWeatherToggle", "Time", TimeStamp())

If ( i > 0 )
   RunAt(TimeStamp()+11, Script)
EndIf
Exit