scripted_gui = {

	sp_event_window = {
		window_name = "sp_event_window"
		context_type = player_context

		visible = {
			has_global_flag = Super_Event_Visible
		}
		
		triggers = {
			Super_Event_Image_West_Russian_War_Zhukov_visible = {
				has_global_flag = WRS_Zhukov_War
			}
		}
		
		triggers = {
			Super_Event_Image_West_Russian_War_Tukhach_visible = {
				has_global_flag = WRS_Tukhach_War
			}
		}
		
		triggers = {
			Super_Event_Image_Siberian_War_visible = {
				has_global_flag = Siberian_War
			}
		}
		
		triggers = {
			Super_Event_Image_WRS_over_wrw_visible = {
				has_global_flag = WRW_wrs_won
			}
		}
		
		triggers = {
			Super_Event_Image_Germany_over_wrw_visible = {
				has_global_flag = WRW_ger_won
			}
		}
		
		triggers = {
			Super_Event_Image_Second_World_War_visible = {
				has_global_flag = GER_WW2
			}
		}
		
		triggers = {
			Super_Event_Image_Third_World_War_visible = {
				has_global_flag = SOV_WW3
			}
		}
	
		triggers = {
			Super_Event_Image_German_Invasion_of_Italy_visible = {
				has_global_flag = GER_Ita
			}
		}
		
		triggers = {
			Super_Event_Image_German_Invasion_of_Hungary_visible = {
				has_global_flag = GER_Hun
			}
		}
		
		triggers = {
			Super_Event_Image_German_Invasion_of_Japan_visible = {
				has_global_flag = GER_Jap
			}
		}
		
		triggers = {
			Super_Event_Image_Paraguayan_Invasion_of_Brazil_visible = {
				has_global_flag = PAR_Bra
			}
		}
		
		triggers = {
			Super_Event_Image_Brazilian_Invasion_of_Paraguay_visible = {
				has_global_flag = BRA_Par
			}
		}
		
		triggers = {
			Super_Event_Image_Communist_America_visible = {
				has_global_flag = USA_Commie
			}
		}
		
		triggers = {
			Super_Event_Image_Fascist_America_visible = {
				has_global_flag = USA_Fascist
			}
		}
		
		triggers = {
			Super_Event_Image_Third_World_War_Allies_visible = {
				has_global_flag = SOV_WW3_NATO
			}
		}
		
		triggers = {
			Super_Event_Image_Sino_Japanese_visible = {
				has_global_flag = JAP_Sino_Japanese
			}
		}
		
		triggers = {
			Super_Event_Image_Spanish_Civil_War_visible = {
				has_global_flag = SPA_Civil_War
			}
		}
		
		triggers = {
			Super_Event_Image_Italian_Civil_War_visible = {
				has_global_flag = Italian_Civil_War
			}
		}
		
		triggers = {
			Super_Event_Image_American_Civil_War_visible = {
				has_global_flag = USA_Civil_War
			}
		}
		
		triggers = {
			Super_Event_Image_American_Civil_War_Fascist_visible = {
				has_global_flag = USA_Civil_War_Fascist
			}
		}
		
		triggers = {
			Super_Event_Image_The_New_Order_visible = {
				has_global_flag = ALL_Fascist
			}
		}
		
		triggers = {
			Super_Event_Image_Global_Hegemony_visible = {
				has_global_flag = ALL_Democratic
			}
		}
		
		triggers = {
			Super_Event_Image_World_Revolution_visible = {
				has_global_flag = ALL_Communist
			}
		}
		
		triggers = {
			Super_Event_Image_Bay_of_Pigs_Invasion_visible = {
				has_global_flag = USA_bay_of_pigs
			}
		}
		
		triggers = {
			Super_Event_Image_Second_American_Mexican_War_visible = {
				has_global_flag = USA_mexican_war
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_of_New_York_visible = {
				has_global_flag = fall_of_new_york_se
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_of_Tokyo_Soviet_visible = {
				has_global_flag = tokyo_soviet
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_of_Tokyo_America_visible = {
				has_global_flag = tokyo_america
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_of_Tokyo_China_visible = {
				has_global_flag = tokyo_china
			}
		}
		
		triggers = {
			Super_Event_Image_Liberation_of_Paris_visible = {
				has_global_flag = Paris_Liberated
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_of_Los_Angeles_visible = {
				has_global_flag = fall_of_los_angeles_se
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_Leopoldine_visible = {
				has_global_flag = GER_Leopoldine
			}
		}
		
		triggers = {
			Super_Event_Image_Pacific_War_visible = {
				has_global_flag = USA_Pacific_War
			}
		}
		
		triggers = {
			Super_Event_Image_Barbarossa_visible = {
				has_global_flag = GER_Barbarossa
			}
		}
		
		triggers = {
			Super_Event_Image_Nationalist_visible = {
				has_global_flag = SPA_Nationalist
			}
		}
		
		triggers = {
			Super_Event_Image_Republican_visible = {
				has_global_flag = SPA_Republican
			}
		}
		
		triggers = {
			Super_Event_Image_Anarchist_visible = {
				has_global_flag = SPA_Anarchist
			}
		}
		
		triggers = {
			Super_Event_Image_Communist_visible = {
				has_global_flag = SPA_Communist
			}
		}
		
		triggers = {
			Super_Event_Image_Falangist_visible = {
				has_global_flag = SPA_Falangist
			}
		}
		
		triggers = {
			Super_Event_Image_Stalinist_visible = {
				has_global_flag = SPA_Stalinist
			}
		}
		
		triggers = {
			Super_Event_Image_Carlist_visible = {
				has_global_flag = SPA_Carlist
			}
		}
		
		triggers = {
			Super_Event_Image_British_Collapse_visible = {
				has_global_flag = ENG_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_Brazil_visible = {
				has_global_flag = BRA_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_Germany_visible = {
				has_global_flag = GER_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Soviet_End_visible = {
				has_global_flag = SOV_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Japanese_Surrender_visible = {
				has_global_flag = JAP_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_America_visible = {
				has_global_flag = USA_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_First_Nuke_visible = {
				has_global_flag = SP_Nuke
			}
		}
		
		#############
		###BRITISH###
		#############
		
		triggers = {
			Super_Event_Image_Imperial_Federation_visible = {
				has_global_flag = UK_ImpFed
			}
		}
		
		triggers = {
			Super_Event_Image_Decolonization_visible = {
				has_global_flag = UK_Decolonization
			}
		}
			
		triggers = {
			Super_Event_Image_King_Party_visible = {
				has_global_flag = UK_King
			}
		}
			
		triggers = {
			Super_Event_Image_Mosley_visible = {
				has_global_flag = UK_Mosley
			}
		}
		
		triggers = {
			Super_Event_Image_Brit_Communist_visible = {
				has_global_flag = UK_Communist
			}
		}
		
		#############
		###GERMANY###
		#############
		
		triggers = {
			Super_Event_Image_Kaiser_WW2_visible = {
				has_global_flag = GER_KaiserWW2
			}
		}
		
		triggers = {
			Super_Event_Image_German_Civil_War_visible = {
				has_global_flag = GER_GCW
			}
		}
		
		triggers = {
			Super_Event_Image_Kaiser_Returns_visible = {
				has_global_flag = GER_Kaiser
			}
		}
		
		triggers = {
			Super_Event_Image_Democratic_Germany_visible = {
				has_global_flag = GER_Democracy
			}
		}
		
		triggers = {
			Super_Event_Image_Endsieg_visible = {
				has_global_flag = GER_Endsieg
			}
		}
		
		triggers = {
			Super_Event_Image_Endsieg_visible = {
				has_global_flag = GER_Endsieg
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_France_visible = {
				has_global_flag = FRA_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_Poland_visible = {
				has_global_flag = POL_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Unholy_Alliance_visible = {
				has_global_flag = GER_Unholy
			}
		}
		
		triggers = {
			Super_Event_Image_Austria_Hungary_visible = {
				has_global_flag = AUS_HUN
			}
		}
		
		triggers = {
			Super_Event_Image_Eastern_Front_visible = {
				has_global_flag = GER_KaiserEast
			}
		}
		
		triggers = {
			Super_Event_Image_Victoria_visible = {
				has_global_flag = GER_Victoria
			}
		}
		
		##########
		###ASIA###
		##########
		
		triggers = {
			Super_Event_Image_Fall_China_visible = {
				has_global_flag = CHI_Fall
			}
		}
		
		triggers = {
			Super_Event_Image_Chinese_Civil_War_visible = {
				has_global_flag = CHI_CW
			}
		}
		
		triggers = {
			Super_Event_Image_China_Yellow_River_visible = {
				has_global_flag = CHI_Yellow_River
			}
		}
		
		triggers = {
			Super_Event_Image_China_Communist_visible = {
				has_global_flag = CHI_CommieUnify
			}
		}
		
		triggers = {
			Super_Event_Image_China_Nationalist_visible = {
				has_global_flag = CHI_NationalistUnify
			}
		}
		
		triggers = {
			Super_Event_Image_Russo_Japanese_visible = {
				has_global_flag = JAP_Russo
			}
		}
		
		triggers = {
			Super_Event_Image_Qing_visible = {
				has_global_flag = MAN_Qing
			}
		}
		
		triggers = {
			Super_Event_Image_PRC_visible = {
				has_global_flag = PRC_Created
			}
		}
		
		triggers = {
			Super_Event_Image_GEACPS_visible = {
				has_global_flag = JAP_GEACPS
			}
		}
		
		triggers = {
			Super_Event_Image_JCW_visible = {
				has_global_flag = JAP_CW
			}
		}
		
		triggers = {
			Super_Event_Image_Chinese_Victory_visible = {
				has_global_flag = CHI_Victory
			}
		}
		
		triggers = {
			Super_Event_Image_Anglo_Iraqi_War_visible = {
				has_global_flag = ENG_Iraqi
			}
		}
		
		triggers = {
			Super_Event_Image_Fall_of_Moscow_Allies_visible = {
				has_global_flag = moscow_allies
			}
		}

		triggers = {
			Super_Event_Image_Ethiopian_Victory_visible = {
				has_global_flag = ETH_Victory
			}
		}
		
		###################
		####No Step Back###
		###################
		
		triggers = {
			Super_Event_Image_SCWC_visible = {
				has_global_flag = SOV_Civil_War_Communist
			}
		}
		
		triggers = {
			Super_Event_Image_SCWW_visible = {
				has_global_flag = SOV_Civil_War_White
			}
		}
		
		triggers = {
			Super_Event_Image_Romanov_visible = {
				has_global_flag = SOV_Romanov
			}
		}
		
		triggers = {
			Super_Event_Image_PLC_visible = {
				has_global_flag = POL_LIT
			}
		}
		
		triggers = {
			Super_Event_Image_Winter_War_visible = {
				has_global_flag = FIN_Winter_War
			}
		}
		
		###############
		###BOSPHORUS###
		###############
		
		triggers = {
			Super_Event_Image_Macedon_visible = {
				has_global_flag = GRE_Macedon
			}
		}
		
		triggers = {
			Super_Event_Image_Byzantine_visible = {
				has_global_flag = GRE_Byzantine
			}
		}
		
		triggers = {
			Super_Event_Image_Ottoman_visible = {
				has_global_flag = TUR_Ottoman
			}
		}
		
		triggers = {
			Super_Event_Image_Turan_visible = {
				has_global_flag = TUR_Turan
			}
		}
		
		triggers = {
			Super_Event_Image_Balkan_visible = {
				has_global_flag = BUL_Balkan
			}
		}
		
		############
		###BUTTON###
		############
		
		effects = {
			sp_event_close_button_click = {
				clr_global_flag = Super_Event_Visible
				
				if = {
					limit = {
						has_global_flag = GER_WW2
					}
					clr_global_flag = GER_WW2
				}
				
				if = {
					limit = {
						has_global_flag = WRS_Zhukov_War
					}
					clr_global_flag = WRS_Zhukov_War
				}
				
				if = {
					limit = {
						has_global_flag = WRS_Tukhach_War
					}
					clr_global_flag = WRS_Tukhach_War
				}
				
				if = {
					limit = {
						has_global_flag = Siberian_War
					}
					clr_global_flag = Siberian_War
				}
				
				if = {
					limit = {
						has_global_flag = WRW_wrs_won
					}
					clr_global_flag = WRW_wrs_won
				}
				
				if = {
					limit = {
						has_global_flag = WRW_ger_won
					}
					clr_global_flag = WRW_ger_won
				}
				
				if = {
					limit = {
						has_global_flag = SOV_WW3
					}
					clr_global_flag = SOV_WW3
				}
				
				if = {
					limit = {
						has_global_flag = GER_Ita
					}
					clr_global_flag = GER_Ita
				}
				
				if = {
					limit = {
						has_global_flag = GER_Hun
					}
					clr_global_flag = GER_Hun
				}
				
				if = {
					limit = {
						has_global_flag = USA_Commie 
					}
					clr_global_flag = USA_Commie 
				}
				
				if = {
					limit = {
						has_global_flag = USA_Fascist
					}
					clr_global_flag = USA_Fascist
				}
				
				if = {
					limit = {
						has_global_flag = GER_Jap
					}
					clr_global_flag = GER_Jap
				}
				
				if = {
					limit = {
						has_global_flag = SOV_WW3_NATO
					}
					clr_global_flag = SOV_WW3_NATO
				}
					
				if = {
					limit = {
						has_global_flag = JAP_Sino_Japanese
					}
					clr_global_flag = JAP_Sino_Japanese
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Civil_War
					}
					clr_global_flag = SPA_Civil_War
				}
				
				if = {
					limit = {
						has_global_flag = Italian_Civil_War
					}
					clr_global_flag = Italian_Civil_War
				}
				
				if = {
					limit = {
						has_global_flag = Paris_Liberated
					}
					clr_global_flag = Paris_Liberated
				}
				
				if = {
					limit = {
						has_global_flag = USA_Civil_War
					}
					clr_global_flag = USA_Civil_War
				}
				
				if = {
					limit = {
						has_global_flag = USA_Civil_War_Fascist
					}
					clr_global_flag = USA_Civil_War_Fascist
				}
				
				if = {
					limit = {
						has_global_flag = USA_bay_of_pigs
					}
					clr_global_flag = USA_bay_of_pigs
				}
				
				if = {
					limit = {
						has_global_flag = USA_mexican_war
					}
					clr_global_flag = USA_mexican_war
				}
				
				if = {
					limit = {
						has_global_flag = fall_of_new_york_se
					}
					clr_global_flag = fall_of_new_york_se
				}

				if = {
					limit = {
						has_global_flag = moscow_allies
					}
					clr_global_flag = moscow_allies
				}
				
				if = {
					limit = {
						has_global_flag = tokyo_soviet
					}
					clr_global_flag = tokyo_soviet
				}
				
				if = {
					limit = {
						has_global_flag = PAR_Bra
					}
					clr_global_flag = PAR_Bra
				}
				
				if = {
					limit = {
						has_global_flag = BRA_Par
					}
					clr_global_flag = BRA_Par
				}
				
				if = {
					limit = {
						has_global_flag = tokyo_america
					}
					clr_global_flag = tokyo_america
				}
				
				if = {
					limit = {
						has_global_flag = tokyo_china
					}
					clr_global_flag = tokyo_china
				}
				
				if = {
					limit = {
						has_global_flag = ETH_Victory
					}
					clr_global_flag = ETH_Victory
				}
				
				if = {
					limit = {
						has_global_flag = fall_of_los_angeles_se
					}
					clr_global_flag = fall_of_los_angeles_se
				}
				
				if = {
					limit = {
						has_global_flag = CHI_Yellow_River
					}
					clr_global_flag = CHI_Yellow_River
				}
				
				if = {
					limit = {
						has_global_flag = GER_Leopoldine
					}
					clr_global_flag = GER_Leopoldine
				}
				
				if = {
					limit = {
						has_global_flag = USA_Pacific_War
					}
					clr_global_flag = USA_Pacific_War
				}
				
				if = {
					limit = {
						has_global_flag = GER_Barbarossa
					}
					clr_global_flag = GER_Barbarossa
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Nationalist
					}
					clr_global_flag = SPA_Nationalist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Republican
					}
					clr_global_flag = SPA_Republican
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Anarchist
					}
					clr_global_flag = SPA_Anarchist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Communist
					}
					clr_global_flag = SPA_Communist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Falangist
					}
					clr_global_flag = SPA_Falangist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Stalinist
					}
					clr_global_flag = SPA_Stalinist
				}
				
				if = {
					limit = {
						has_global_flag = SPA_Carlist
					}
					clr_global_flag = SPA_Carlist
				}
				
				if = {
					limit = {
						has_global_flag = ENG_Fall
					}
					clr_global_flag = ENG_Fall
				}
				
				if = {
					limit = {
						has_global_flag = ENG_Iraqi
					}
					clr_global_flag = ENG_Iraqi
				}
				
				if = {
					limit = {
						has_global_flag = ALL_Fascist
					}
					clr_global_flag = ALL_Fascist
				}
				
				if = {
					limit = {
						has_global_flag = ALL_Democratic
					}
					clr_global_flag = ALL_Democratic
				}
				
				if = {
					limit = {
						has_global_flag = ALL_Communist
					}
					clr_global_flag = ALL_Communist
				}
				
				if = {
					limit = {
						has_global_flag = GER_Fall
					}
					clr_global_flag = GER_Fall
				}
				
				if = {
					limit = {
						has_global_flag = SOV_Fall
					}
					clr_global_flag = SOV_Fall
				}
				
				if = {
					limit = {
						has_global_flag = BRA_Fall
					}
					clr_global_flag = BRA_Fall
				}
				
				if = {
					limit = {
						has_global_flag = JAP_Fall
					}
					clr_global_flag = JAP_Fall
				}
				
				if = {
					limit = {
						has_global_flag = USA_Fall
					}
					clr_global_flag = USA_Fall
				}
				
				if = {
					limit = {
						has_global_flag = SP_Nuke
					}
					clr_global_flag = SP_Nuke
				}
				
				#############
				###BRITISH###
				#############
				
				if = {
					limit = {
						has_global_flag = UK_ImpFed
					}
					clr_global_flag = UK_ImpFed
				}
				
				if = {
					limit = {
						has_global_flag = UK_Decolonization
					}
					clr_global_flag = UK_Decolonization
				}
				
				if = {
					limit = {
						has_global_flag = UK_King
					}
					clr_global_flag = UK_King
				}
				
				if = {
					limit = {
						has_global_flag = UK_Mosley
					}
					clr_global_flag = UK_Mosley
				}
				
				if = {
					limit = {
						has_global_flag = UK_Communist
					}
					clr_global_flag = UK_Communist
				}
				
				#############
				###GERMANY###
				#############
				
				if = {
					limit = {
						has_global_flag = GER_KaiserWW2
					}
					clr_global_flag = GER_KaiserWW2
				}
				
				if = {
					limit = {
						has_global_flag = GER_KaiserWW2
					}
					clr_global_flag = GER_KaiserWW2
				}
				
				if = {
					limit = {
						has_global_flag = GER_GCW
					}
					clr_global_flag = GER_GCW
				}
				
				if = {
					limit = {
						has_global_flag = GER_Kaiser
					}
					clr_global_flag = GER_Kaiser
				}
				
				if = {
					limit = {
						has_global_flag = GER_Democracy
					}
					clr_global_flag = GER_Democracy
				}
				
				if = {
					limit = {
						has_global_flag = GER_Endsieg
					}
					clr_global_flag = GER_Endsieg
				}
				
				if = {
					limit = {
						has_global_flag = FRA_Fall
					}
					clr_global_flag = FRA_Fall
				}
				
				if = {
					limit = {
						has_global_flag = POL_Fall
					}
					clr_global_flag = POL_Fall
				}
				
				if = {
					limit = {
						has_global_flag = GER_Unholy
					}
					clr_global_flag = GER_Unholy
				}
				
				if = {
					limit = {
						has_global_flag = AUS_HUN
					}
					clr_global_flag = AUS_HUN
				}
				
				if = {
					limit = {
						has_global_flag = GER_KaiserEast
					}
					clr_global_flag = GER_kaiserEast
				}
				
				if = {
					limit = {
						has_global_flag = GER_Victoria
					}
					clr_global_flag = GER_Victoria
				}
				
				##########
				###ASIA###
				##########
				
				if = {
					limit = {
						has_global_flag = CHI_Fall
					}
					clr_global_flag = CHI_Fall
				}
				
				if = {
					limit = {
						has_global_flag = CHI_CW
					}
					clr_global_flag = CHI_CW
				}
				
				if = {
					limit = {
						has_global_flag = CHI_CommieUnify
					}
					clr_global_flag = CHI_CommieUnify
				}
				
				if = {
					limit = {
						has_global_flag = CHI_NationalistUnify
					}
					clr_global_flag = CHI_NationalistUnify
				}
				
				if = {
					limit = {
						has_global_flag = JAP_Russo
					}
					clr_global_flag = JAP_Russo
				}
				
				if = {
					limit = {
						has_global_flag = MAN_Qing
					}
					clr_global_flag = MAN_Qing
				}
				
				if = {
					limit = {
						has_global_flag = PRC_Created
					}
					clr_global_flag = PRC_Created
				}
				
				if = {
					limit = {
						has_global_flag = JAP_GEACPS
					}
					clr_global_flag = JAP_GEACPS
				}
				
				if = {
					limit = {
						has_global_flag = JAP_CW
					}
					clr_global_flag = JAP_CW
				}
				
				if = {
					limit = {
						has_global_flag = CHI_Victory
					}
					clr_global_flag = CHI_Victory
				}
				
				###################
				####No Step Back###
				###################
				
				if = {
					limit = {
						has_global_flag = SOV_Civil_War_Communist
					}
					clr_global_flag = SOV_Civil_War_Communist
				}
				
				if = {
					limit = {
						has_global_flag = SOV_Civil_War_White
					}
					clr_global_flag = SOV_Civil_War_White
				}
				
				if = {
					limit = {
						has_global_flag = SOV_Romanov
					}
					clr_global_flag = SOV_Romanov
				}
				
				if = {
					limit = {
						has_global_flag = POL_LIT
					}
					clr_global_flag = POL_LIT
				}
				
				if = {
					limit = {
						has_global_flag = FIN_Winter_War
					}
					clr_global_flag = FIN_Winter_War
				}
				
				###############
				###BOSPHORUS###
				###############
				
				if = {
					limit = {
						has_global_flag = GRE_Macedon
					}
					clr_global_flag = GRE_Macedon
				}
				
				if = {
					limit = {
						has_global_flag = GRE_Byzantine
					}
					clr_global_flag = GRE_Byzantine
				}
				
				if = {
					limit = {
						has_global_flag = TUR_Ottoman
					}
					clr_global_flag = TUR_Ottoman
				}
				
				if = {
					limit = {
						has_global_flag = TUR_Turan
					}
					clr_global_flag = TUR_Turan
				}
				
				if = {
					limit = {
						has_global_flag = BUL_Balkan
					}
					clr_global_flag = BUL_Balkan
				}
			}
		}
	}
}