#include "game.lua"


function justPassed(t)
	return gTime >= t and gTimeLast < t
end


function getFirst(str,split)
	split = split or " "
	i = string.find(str, split)
	if i then
		return string.sub(str, 1, i-1)
	else 
		return str
	end
end

function getSecond(str, split)
	split = split or " "
	i = string.find(str, split)
	if i then
		return string.sub(str, i+1, string.len(str))
	end
	return ""
end

function split (inputstr, sep)
        if sep == nil then
                sep = "%s"
        end
        local t={}
        --print("****************\n")
        for str in string.gmatch(inputstr, "([^"..sep.."]+)") do
        		--print("str: " .. str .. " | " .. sep)
                table.insert(t, str)
        end
        --print("****************\n")
        return t
end



--------------------------------------------------------------------------------------------------------------------


function pause(dt, params)
	return gTime < params.length
end


--------------------------------------------------------------------------------------------------------------------

function newsIntro(dt, params)
	if gTime == 0 then
		logo = 0
		breaking = -400
		news = 400
		white = 0
		UiSound("tv/news-intro.ogg")
	end

	if justPassed(0.2) then
		SetValue("logo", 8, "bounce", 1)
	end
	if justPassed(1.3) then
		SetValue("breaking", 30, "easeout", 0.4)
	end
	if justPassed(1.5) then
		SetValue("news", 30, "easeout", 0.4)
	end
	if justPassed(1.9) then
		white = 0.5
		SetValue("white", 0, "linear", 1.4)
	end

	UiPush()
		UiTranslate(UiCenter(), UiMiddle())
		UiFont("bold.ttf", 24)
		UiColor(0.5,0,0)
		UiPush()
			UiTranslate(0, -50)
			UiScale(logo)
			UiAlign("center middle")
			UiText("LCN")
		UiPop()
		UiPush()
			UiTranslate(breaking, 70)
			UiScale(3.0)
			UiAlign("right")
			UiText("Ãòô¿ýìé")
		UiPop()
		UiPush()
			UiTranslate(news, 70)
			UiScale(3.0)
			UiAlign("left")
			UiText("ñòåòõöì")
		UiPop()
	UiPop()
	UiColor(1,1,1,white)
	UiRect(640, 480)
	
	return gTime < 4.0
end

function newsOutro(dt, params)
	host = "Âéèùÿã¿ - Ë½öïìñ Ò½ñèõöôìð"

	if gTime == 0 then
		logo = 0
		breaking = -400
		news = 400
		white = 0
		UiSound("tv/news-outro.ogg")
	end

	UiImage("tv/news_end.jpg")

	UiPush()
		UiFont("bold.ttf", 24)
		UiAlign("left middle")
		UiTranslate(0, 380)
		UiColor(1,1,1, 0.5)
		UiRect(330, 30)
		UiColor(0,0,0)
		UiTranslate(10, 0)
		UiText(host)
	UiPop()

	if justPassed(0.2) then
		SetValue("logo", 8, "bounce", 1)
	end
	
	UiPush()
		UiTranslate(UiCenter(), UiMiddle())
		UiFont("bold.ttf", 24)
		UiColor(0.5,0,0)
		UiPush()
			UiTranslate(0, -50)
			UiScale(logo)
			UiAlign("center middle")
			UiText("LCN")
		UiPop()
	UiPop()
	UiColor(1,1,1,white)
	UiRect(640, 480)
	
	return gTime < 4.0
end


--------------------------------------------------------------------------------------------------------------------

function mysteryIntro(dt, params)
	local lengthTime = 8
	
	if gTime == 0 then
		creep = 500
		SetValue("creep", 0, "easeout", 1.4)
		UiSound("tv/mystery.ogg")
		sia1 = 0
		sia2 = 0
		sia3 = 0
		sia4 = 0
		sis1 = 0
		sis2 = 0
		sis3 = 0
		sis4 = 0
	end


	--subimage1
	if justPassed(0.5) then
		SetValue("sia1", 1, "easein", 1)
		SetValue("sis1", 4, "linear", 4)
	end
	if justPassed(2.5) then
		SetValue("sia1", 0, "easeout", 3)
	end

	--subimage2
	if justPassed(1.5) then
		SetValue("sia2", 1, "easein", 1)
		SetValue("sis2", 4, "linear", 4)
	end
	if justPassed(3.5) then
		SetValue("sia2", 0, "easeout", 3)
	end

	--subimage3
	if justPassed(2.5) then
		SetValue("sia3", 1, "easein", 1)
		SetValue("sis3", 4, "linear", 4)
	end
	if justPassed(4.5) then
		SetValue("sia3", 0, "easeout", 3)
	end

	--subimage4
	if justPassed(3.5) then
		SetValue("sia4", 1, "easein", 1)
		SetValue("sis4", 4, "linear", 4)
	end
	if justPassed(5.5) then
		SetValue("sia4", 0, "easeout", 3)
	end

	UiPush()
		local subImageSizeFactor = 0.5
		local subImageMoveFactor = 0.25
		local subImageMoveLength = UiWidth() / (lengthTime*2)

		-- BG eye
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter(), UiMiddle())
			UiColorFilter(1,1,1,gTime)
			UiScale(1+gTime*0.1)
			UiImage("tv/mystery-eye.jpg")
		UiPop()
		-- Subimage1
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() + sis1*subImageMoveLength, UiMiddle() + sis1*subImageMoveLength)
			UiColorFilter(1,1,1,sia1)
			UiScale(sis1*subImageSizeFactor)
			UiImage("tv/mystery-ankh.png")
		UiPop()
		-- Subimage1
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() + sis2*subImageMoveLength, UiMiddle() - sis2*subImageMoveLength)
			UiColorFilter(1,1,1,sia2)
			UiScale(sis2*subImageSizeFactor)
			UiImage("tv/mystery-ufo.png")
		UiPop()
		-- Subimage3
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() - sis3*subImageMoveLength, UiMiddle() - sis3*subImageMoveLength)
			UiColorFilter(1,1,1,sia3)
			UiScale(sis3*subImageSizeFactor)
			UiImage("tv/mystery-ufonews.png")
		UiPop()
		-- Subimage4
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() - sis4*subImageMoveLength, UiMiddle() + sis4*subImageMoveLength)
			UiColorFilter(1,1,1,sia4)
			UiScale(sis4*subImageSizeFactor)
			UiImage("tv/mystery-pyramids.png")
		UiPop()

		UiColor(0.5, 0, 0, 1)
		UiFont("bold.ttf", 96)
		UiTranslate(0, creep)
		UiPush()
			UiTranslate(UiCenter() - 160 + math.sin(gTime*2.2) * 12, UiMiddle() - 120 + math.sin(gTime*2) * 20)
			UiText("à")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() - 80 - math.sin(gTime*1.8) * 16, UiMiddle() - 120 - math.sin(gTime*2.4) * 14)
			UiText("Ó")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() + 0 + math.sin(gTime*2.6) * 18, UiMiddle() - 120 + math.sin(gTime*1.8) * 16)
			UiText("Ï")
		UiPop()

		UiPush()
			UiTranslate(UiCenter() - 280 + math.sin(gTime*2.2) * 12, UiMiddle() + math.sin(gTime*2) * 20)
			UiText("Í")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() - 160 - math.sin(gTime*1.8) * 12, UiMiddle() - math.sin(gTime*2.4) * 14)
			UiText("É")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() - 80 + math.sin(gTime*2.6) * 20, UiMiddle() + math.sin(gTime*1.8) * 14)
			UiText("Ò")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() - 0 - math.sin(gTime*2.8) * 8, UiMiddle() - math.sin(gTime*3) * 10)
			UiText("Ó")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() + 80 + math.sin(gTime*1.1) * 13, UiMiddle() + math.sin(gTime*1.5) * 18)
			UiText("É")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() + 160 - math.sin(gTime*3.2) * 18, UiMiddle() - math.sin(gTime*2.2) * 12)
			UiText("Ë")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() + 240 + math.sin(gTime*2.3) * 14, UiMiddle() + math.sin(gTime*2.8) * 6)
			UiText(" ")
		UiPop()

		UiPush()
			UiTranslate(UiCenter() - 80 + math.sin(gTime*2.2) * 12, UiMiddle() + 120 + math.sin(gTime*2) * 18)
			UiText("Û")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() - 0 - math.sin(gTime*1.8) * 10, UiMiddle() + 120 - math.sin(gTime*2.4) * 14)
			UiText("Ï")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() + 80 + math.sin(gTime*2.6) * 16, UiMiddle() + 120 + math.sin(gTime*1.8) * 20)
			UiText("Ô")
		UiPop()
		UiPush()
			UiTranslate(UiCenter() + 160 + math.sin(gTime*2.6) * 14, UiMiddle() + 120 + math.sin(gTime*1.8) * 12)
			UiText(" ")
		UiPop()
	UiPop()
	
	return gTime < lengthTime
end


--------------------------------------------------------------------------------------------------------------------

function diyIntro(dt, params)
	local lengthTime = 8
	
	if gTime == 0 then
		creep = 500
		SetValue("creep", 0, "easeout", 1.4)
		UiSound("tv/diy-intro.ogg")
		sia1 = 0
		sia2 = 0
		sia3 = 0
		sia4 = 0
		sis1 = 0
		sis2 = 0
		sis3 = 0
		sis4 = 0
	end


	--subimage1
	if justPassed(0.5) then
		SetValue("sia1", 1, "easein", 1)
		SetValue("sis1", 4, "linear", 4)
	end
	if justPassed(2.5) then
		SetValue("sia1", 0, "easeout", 3)
	end

	--subimage2
	if justPassed(1.5) then
		SetValue("sia2", 1, "easein", 1)
		SetValue("sis2", 4, "linear", 4)
	end
	if justPassed(3.5) then
		SetValue("sia2", 0, "easeout", 3)
	end

	--subimage3
	if justPassed(2.5) then
		SetValue("sia3", 1, "easein", 1)
		SetValue("sis3", 4, "linear", 4)
	end
	if justPassed(4.5) then
		SetValue("sia3", 0, "easeout", 3)
	end

	--subimage4
	if justPassed(3.5) then
		SetValue("sia4", 1, "easein", 1)
		SetValue("sis4", 4, "linear", 4)
	end
	if justPassed(5.5) then
		SetValue("sia4", 0, "easeout", 3)
	end

	UiPush()
		local subImageSizeFactor = 0.5
		local subImageMoveFactor = 0.25
		local subImageMoveLength = UiWidth() / (lengthTime*2)

		-- BG eye
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter(), UiMiddle())
			UiColorFilter(1,1,1,gTime)
			UiScale(1+gTime*0.1)
			UiImage("tv/diybg.jpg")
		UiPop()
		-- Subimage1
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() + sis1*subImageMoveLength, UiMiddle() + sis1*subImageMoveLength)
			UiColorFilter(1,1,1,sia1)
			UiScale(sis1*subImageSizeFactor)
			UiImage("tv/diy1.png")
		UiPop()
		-- Subimage1
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() + sis2*subImageMoveLength, UiMiddle() - sis2*subImageMoveLength)
			UiColorFilter(1,1,1,sia2)
			UiScale(sis2*subImageSizeFactor)
			UiImage("tv/diy2.png")
		UiPop()
		-- Subimage3
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() - sis3*subImageMoveLength, UiMiddle() - sis3*subImageMoveLength)
			UiColorFilter(1,1,1,sia3)
			UiScale(sis3*subImageSizeFactor)
			UiImage("tv/diy3.png")
		UiPop()
		-- Subimage4
		UiPush()
			UiAlign("center middle")
			UiTranslate(UiCenter() - sis4*subImageMoveLength, UiMiddle() + sis4*subImageMoveLength)
			UiColorFilter(1,1,1,sia4)
			UiScale(sis4*subImageSizeFactor)
			UiImage("tv/diy4.png")
		UiPop()
	UiPop()
	
	return gTime < lengthTime
end


--------------------------------------------------------------------------------------------------------------------


function news(dt, params)
	reporter = params.reporter or "reporter"
	public = params.public or "man"

	if gTime == 0 then
		tickerPos = 900
		done = false
		hideticker = 1
		event = 0
		eventTimer = 0.0
		eventTime = 0.0
		endSound = false
				
		randomStudio = math.random(0,3)
		randomReporter = math.random(0,3)

	end

	if justPassed(1.0) then
		SetValue("hideticker", 0, "easeout", 0.4)
	end

	if eventTimer <= 0.0 then
		event = event + 1
		if event > #params.events then
			event = 1
		end
		eventTimer = 5.0
		eventTime = 0.0
	end
	
	if event > 0 then
		local prevFirst = ""
		local prevSecond = ""
		if event > 1 then
			prevFirst = getFirst(params.events[event-1])
			prevSecond = getSecond(params.events[event-1])
		end

		local nextFirst = ""
		local nextSecond = ""
		if event < #params.events-1 then
			nextFirst = getFirst(params.events[event+1])
			nextSecond = getSecond(params.events[event+1])
		end

		if prevFirst == "reporter" or prevFirst == "interview" then prevSecond = "" end
		if nextFirst == "reporter" or nextFirst == "interview" then nextSecond = "" end

		local e = params.events[event]
		local first = getFirst(e)
		local second = getSecond(e)
		if first == "studio" then
			if blink then
				UiImage("tv/news_blink.jpg")
			else
				if talk then
					UiImage("tv/news_talk.jpg")
				else
					UiImage("tv/news.jpg")
				end
			end
			if second ~= "" then
				UiPush()
					local t = 1.0
					if second == prevSecond and eventTime < 0.5 then
						t = eventTime*2.0
					end
					if second == nextSecond and eventTimer < 0.5 then
						t = eventTimer*2.0
					end
					UiTranslate(320*t, 70*t)
					UiScale(1.0-0.6*t)
					UiImage(second)
				UiPop()
			end
		elseif first == "still" then
			UiImage(second)
		elseif first == "zoom" then
			UiPush()
				UiAlign("center middle")
				UiTranslate(UiCenter(), UiMiddle())
				UiScale(1 + eventTime*0.03)
				UiImage(second)
			UiPop()
		elseif first == "shake" then
			UiPush()
				UiTranslate(UiCenter() + shakeX*10, UiMiddle() + shakeY*10)
				UiAlign("center middle")
				UiScale(1.05)
				UiPush()
					UiRotate(math.deg((shakeX+shakeY)*0.005))
					UiImage(second)
				UiPop()
				UiTranslate(-shakeX*5, -shakeY*5)
				UiRotate(math.deg((shakeX+shakeY)*0.002))
				if gFrame%130 < 5 then
					UiImage("tv/" .. reporter .. "_blink.png")
				else
					if talk then
						UiImage("tv/" .. reporter .. "_talk.png")
					else
						UiImage("tv/" .. reporter .. ".png")
					end
				end
			UiPop()
		elseif first == "reporter" then
			UiPush()				
				UiTranslate(UiCenter() + shakeX*10, UiMiddle() + shakeY*10)
				UiAlign("center middle")
				UiScale(1.05)
				UiPush()
					UiRotate(math.deg((shakeX+shakeY)*0.005))
					UiImage(second)
				UiPop()
				UiTranslate(-shakeX*5, -shakeY*5)
				UiRotate(math.deg((shakeX+shakeY)*0.002))
				if reporter ~= "" then
					if blink then
						UiImage("tv/" .. reporter .. "_blink.png")
					else
						if talk then
							UiImage("tv/" .. reporter .. "_talk.png")
						else
							UiImage("tv/" .. reporter .. ".png")
						end
					end
				end
			UiPop()
		elseif first == "interview" then
			UiPush()				
				UiTranslate(UiCenter() + shakeX*10, UiMiddle() + shakeY*10)
				UiAlign("center middle")
				UiScale(1.05)
				UiPush()
					UiRotate(math.deg((shakeX+shakeY)*0.005))
					UiImage(second)
				UiPop()
				UiTranslate(-shakeX*5, -shakeY*5)
				UiImage("tv/" .. public .. ".png")
				UiTranslate(-shakeX*5, -shakeY*5)
				UiRotate(math.deg((shakeX+shakeY)*0.002))
				if reporter ~= "" then
					if blink then
						UiImage("tv/" .. reporter .. "_blink.png")
					else
						if talk then
							UiImage("tv/" .. reporter .. "_talk.png")
						else
							UiImage("tv/" .. reporter .. ".png")
						end
					end
				end
			UiPop()
		end
		
		if first == "reporter" or first == "interview" then
			UiSoundLoop("tv/reporter" .. randomReporter .. ".ogg", .5)
		else
			UiSoundLoop("tv/studio" .. randomStudio .. ".ogg", .5)
		end
	end
	
	eventTimer = eventTimer - dt
	eventTime = eventTime + dt
	
	UiPush()
		UiTranslate(0, 390 + 120*hideticker)
		UiColor(0.3, 0.0, 0.0)
		UiRect(640, 60)

		UiPush()
			UiFont("bold.ttf", 24)
			UiAlign("left middle")
			UiTranslate(0, -15)
			UiColor(1,1,1, 0.5)
			UiRect(330, 30)
			UiColor(0,0,0)
			UiTranslate(10, 0)
			UiText(params.title)
		UiPop()
		
		UiColor(1,1,1)
		UiTranslate(tickerPos, 30)
		tickerPos = tickerPos - dt*170
		UiFont("bold.ttf", 24)
		UiScale(2.0)
		UiAlign("left middle")
		local w, h = UiText(params.ticker)
		if tickerPos + w*2.0 < 0 then
			done = true
		end
	UiPop()

	UiPush()
		UiTranslate(580, 12)
		UiColor(1, 1, 1, 0.5)
		UiRect(60, 26)

		UiTranslate(10, 20)
		UiColor(0.5, 0, 0, 1)
		UiFont("bold.ttf", 24)
		UiText("LCN")
	UiPop()

	return not done
end

--------------------------------------------------------------------------------------------------------------------


function mystery(dt, params)
	if gTime == 0 then
		done = false
		event = 0
		subs = false
		eventTimer = 0.0
		eventTime = 0.0
		alpha = 3
		eventLength = params.eventlength
		bgimage = params.bgimage
		bgsound = params.bgsound
	end
	UiPush()

	if eventTimer <= 0.0 then
		event = event + 1
		if event > #params.events then
			done = true
			event = #params.events
		end

			eventLength = getSecond(getFirst(params.events[event],"|"),"*")
			if eventLength == nil then
				eventLength = 4.0
			end
			eventTimer = eventLength
			eventTime = 0.0

	end
	
	if event > 0 and event <= #params.events then
		UiSoundLoop(bgsound)
		local e = params.events[event]
		local first = getFirst(getFirst(e,"|"),"*")
		local second = getSecond(e,"|")
		local images = split(second)
		if first == "title" then
			UiPush()
				UiPush()
					UiAlign("center middle")
					UiTranslate(UiCenter(), UiMiddle())
					if params.bgzoom > 0 then
						UiScale(1 + gTime*0.05)
					end
					UiImage(bgimage)
				UiPop()
				UiAlign("center middle")
				UiTranslate(UiWidth()/2,UiHeight()/2)
				UiScale(1+eventTime*0.1)
				UiFont("bold.ttf", 48)
				UiText(second)
			UiPop()
		elseif first == "outro" then
			alpha = alpha - dt
			UiColorFilter(1,1,1,alpha)
			UiPush()
				UiPush()
					UiAlign("center middle")
					UiTranslate(UiCenter(), UiMiddle())
					if params.bgzoom > 0 then
						UiScale(1 + gTime*0.05)
					end
					UiImage(bgimage)
				UiPop()
				UiAlign("center middle")
				UiTranslate(UiWidth()/2,UiHeight()/2)
				UiScale(1+eventTime*0.1)
				UiFont("bold.ttf", 48)
				UiText(second)
			UiPop()
		else
			UiPush()
				UiAlign("center middle")
				UiTranslate(UiCenter(), UiMiddle())
				if params.bgzoom > 0 then
					UiScale(1 + gTime*0.05)
				end
				UiImage(bgimage)
			UiPop()
			

			if #images > 1 then
				local timePerImage = eventLength/(#images)
				for i= 0, math.floor(eventTime/(timePerImage)),1 do
					UiPush()
						--if i == 0 then
						--	UiColorFilter(1,1,1,1)
						--else
							UiColorFilter(1,1,1,eventTime-timePerImage*i)
						--end
						
						--UiColorFilter(1,1,1,eventTimer)
						UiAlign("center middle")
						UiTranslate(UiWidth()/2,UiHeight()/2)
						UiImage(images[i+1])
					UiPop()
				end
			else
				UiPush()
					UiAlign("center middle")
					UiTranslate(UiWidth()/2,UiHeight()/2)
					if #images == 1 then
						UiScale(1+eventTime*0.1)
					end
					UiImage(images[1])
				UiPop()	
			end
			if eventTime > 0.5 and eventTime < eventLength-0.5 then
				subs = true
			else
				subs = false
			end
			if subs then
				UiPush()
					UiColor(0, 0, 0, 1)
					UiAlign("top left")
					UiFont("bold.ttf", 32)
					local textw, texth = UiGetTextSize(first)
					UiTranslate(UiWidth()/2 - textw/2 - 10,UiHeight()-100 - 10)
					UiRect(textw + 10, texth + 10)
					UiColor(1, 1, 1, 1)
					UiTranslate(5,5)
					UiText(first)
				UiPop()
			end
		end
		UiPop()
	end
	
	eventTimer = eventTimer - dt
	eventTime = eventTime + dt
	
	return not done
end


--------------------------------------------------------------------------------------------------------------------



function commercial1(dt, params)
	if gTime == 0 then
		UiSound("tv/auction.ogg")
		top = 0
		middle = 0
		bottom = 0
	end

	if justPassed(1.0) then
		SetValue("top", 1, "linear", 0.3)
	end
	if justPassed(2.0) then
		SetValue("middle", 1, "linear", 0.3)
	end
	if justPassed(3.0) then
		SetValue("bottom", 1, "linear", 0.3)
	end

	UiImage(params.image)

	UiAlign("center middle")
	UiFont("bold.ttf", 24)

	if params.top then
		UiPush()
			local a = top
			UiTranslate(UiCenter(), UiMiddle()-100 - (1.0-a)*200)
			UiScale(2.0)
			UiTextOutline(0, 0, 0, a, 0.2)
			UiColor(1, 1, 1, a)
			UiText(params.top)
		UiPop()
	end
	if params.middle then
		UiPush()
			local a = middle
			UiTranslate(UiCenter(), 240)
			UiScale(3.0*a)
			UiTextOutline(0, 0, 0, a, 0.2)
			UiColor(0.5, 1, 1, a)
			UiText(params.middle)
		UiPop()
	end
	if params.bottom then
		UiPush()
			local a = bottom
			UiTranslate(UiCenter(), UiMiddle()+100 + (1.0-a)*200)
			UiScale(2.0)
			UiTextOutline(0, 0, 0, a, 0.2)
			UiColor(1, 1, 0, a)
			UiText(params.bottom)
		UiPop()
	end

	return gTime < 8
end


--------------------------------------------------------------------------------------------------------------------



function commercial(dt, params)
	if gTime == 0 then
		UiSound(params.audio)
		top1 = 0
		bottom1 = 0
		top2 = 0
		bottom2 = 0
		image2 = 0
		fade = 1

		color1 = params.color1 or {r=1, g=1, b=1}
		color2 = params.color2 or {r=1, g=1, b=1}
		color3 = params.color3 or {r=1, g=1, b=1}
		color4 = params.color4 or {r=1, g=1, b=1}

		font1 = params.font1 or "bold.ttf"
		font2 = params.font2 or "bold.ttf"
		font3 = params.font3 or "bold.ttf"
		font4 = params.font4 or "bold.ttf"

		size1 = params.size1 or 24
		size2 = params.size2 or 24
		size3 = params.size3 or 24
		size4 = params.size4 or 24
	end

	if justPassed(1.0) then
		SetValue("top1", 1, "linear", 0.3)
	end
	if justPassed(2.0) then
		SetValue("bottom1", 1, "linear", 0.3)
	end
	
	if justPassed(4.8) then
		SetValue("fade", 0, "easeout", 0)
	end

	if justPassed(5.0) then
		SetValue("top2", 1, "linear", 0.3)
	end
	if justPassed(6.0) then
		SetValue("bottom2", 1, "linear", 0.3)
	end

	if gTime >= 5.0 then
		UiPush()
			if params.zoom2 then
				UiAlign("center middle")
				UiTranslate(UiCenter(), UiMiddle())
				UiScale(1 + gTime*0.03)
			end
			UiImage(params.image2)
		UiPop()
		UiAlign("center middle")
	end

	if params.text3 then
		UiPush()
			local a = top2
			UiFont(font3, size3)
			UiTranslate(UiCenter(), UiMiddle()-150 - (1.0-a)*200)
			UiScale(2.5)
			UiTextOutline(0, 0, 0, a, 0.3)
			UiColor(color3.r, color3.g, color3.b, a)
			UiText(params.text3)
		UiPop()
	end
	if params.text4 then
		UiPush()
			local a = bottom2
			UiFont(font4, size4)
			UiTranslate(UiCenter(), UiMiddle()+150 + (1.0-a)*200)
			UiScale(2.5)
			UiTextOutline(0, 0, 0, a, 0.3)
			UiColor(color4.r, color4.g, color4.b, a)
			UiText(params.text4)
		UiPop()
	end

	if gTime < 5.0 then
		UiPush()
			if params.zoom1 then
				UiAlign("center middle")
				UiTranslate(UiCenter(), UiMiddle())
				UiScale(1 + gTime*0.03)
			end
			UiImage(params.image1)
		UiPop()
		
		UiAlign("center middle")

		if params.text1 then
			UiPush()
				local a = top1
				UiFont(font1, size1)	
				UiTranslate(UiCenter(), UiMiddle()-150 - (1.0-a)*200)
				UiScale(2.5)
				UiTextOutline(0, 0, 0, a, 0.3)
				UiColor(color1.r, color1.g, color1.b, a)
				UiText(params.text1)
			UiPop()
		end
		if params.text2 then
			UiPush()
				local a = bottom1
				UiFont(font2, size2)
				UiTranslate(UiCenter(), UiMiddle()+150 + (1.0-a)*200)
				UiScale(2.5)
				UiTextOutline(0, 0, 0, a, 0.3)
				UiColor(color2.r, color2.g, color2.b, a)
				UiText(params.text2)
			UiPop()
		end
	end
	
	return gTime < 11
end


--------------------------------------------------------------------------------------------------------------------


function addShow(showFunc, showParams)
	gShows[#gShows+1] = {func = showFunc, params = showParams}
end


function isMissionCompleted(missionId)
	return GetInt("savegame.mission."..missionId..".score") > 0
end


function init()
	gTime = 0
	gTimeLast = 0
	gFrame = 0
	gFadeToBlack = 0

	gShows = {}
	addShow(pause, {length = 1})

	local lastCompleted = GetString("savegame.lastcompleted")


	if not isMissionCompleted("mall_intro") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Òòôåãññºé èòûòèº",
				ticker = "Â õéîöòôé õñòõã óò-óôéêñéðù ñãäï¾èãéöõ¿ ôéëîòé óãèéñìé åºôùýîì å îòñüé îåãôöãïã, îòçèã õöôòìöéï¼õöåò óôéåëòþïò õñòõ ñã 437%. \"Áìëñéõ èéðòñöãêã ì õñòõã öéóéô¼ óôòõöò ñé öòö, îãîìð òñ äºï ôãñ¼þé\", - çòåòôìö Óôéíõì, óôéèõöãåìöéï¼ óôéèóôì¿öì¿ \"Ôõïùçì Äéðòñöãêã Ìéîéïï¿\".",
				events = 
				{
					"studio", 
					"studio tv/demochart.jpg", 
					"still tv/demochart.jpg", 
					"still tv/demochart.jpg", 
					"studio tv/tracy-mugshot.jpg", 
					"studio", 
					"studio", 
				}
			}	
		)
		addShow(news,
			{
				title = "\"Öìðìîãöº Ìì\" å ùäºöîãû",
				ticker = "Ðôéèóôì¿öìé ñãîòñéü-öò òóùäïìîòåãïò õåòì ðôãýñºé óòîãëãöéïì ëã óòõïéèñìí úìñãñõòåºí çòè. Ãéñéôãï¼ñºí èìôéîöòô Ìòùôéñõ Ìì-ðïãèþìí çòåòôìö, ýöò òñì ôãõþìôìïìõ¼ ñã \"ñòåºé ôºñîì\", ñò ñé ûòýéö åèãåãö¼õ¿ å èãï¼ñéíþìé óòèôòäñòõöì.",
				events = 
				{
					"studio", 
					"studio tv/lee.jpg", 
					"zoom tv/lee.jpg", 
					"studio",
				}
			}	
		)
		addShow(newsOutro)
	end

	if isMissionCompleted("mall_intro") and not isMissionCompleted("lee_computers") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ïä¹éîö îùï¼öùôñòçò ñãõïéèì¿ ùñìýöòêéñ",
				ticker = "Íéõöñºí ëñãðéñìöºí ñãôòèñºí ðùëéí Ìéîîéï¿ äºï õñéõéñ. Òðòöôìöéï¼ ì ½ñöùëìãõö Áôéö Äêòñõòñ, îòçèã óôìäºï õéçòèñ¿ ùöôòð, òäñãôùêìï, ýöò ëèãñìé ôãëôùþéñò. Ðò èãññºð óòïìüìì, óôéõöùóñìîì äºõöôò ôãëòäôãïìõ¼ õò õöãôºð ëèãñìéð. Îãýãöò ôãõõïéèòåãñìé.",
				events = 
				{
					"zoom tv/mall-intro-intro.jpg", 
					"studio tv/mall-intro-intro.jpg", 
					"studio tv/mall-intro-bg.jpg", 
					"interview tv/mall-intro-bg.jpg", 
					"zoom tv/mall-intro1.jpg",  
					"studio tv/mall-intro1.jpg", 
					"studio", 
				}
			}	
		)
		addShow(news,
			{
				title = "Ðôéèóôì¿öìé \"Öìðìîãöº Ìì\" óéôééûãïò",
				ticker = "Ðôéèóôì¿öìé óéôéñòõìö ýãõö¼ õåòéí èé¿öéï¼ñòõöì ñã Èãóãèñºí Ðòôö. \"àöò òöîôºåãéö åòëðòêñòõöì å ñòåºû õúéôãû äìëñéõã, çèé ðº åðéõöé õ ñãþìðì óãôöñéôãðì ðòêéð ôãëôùþìö¼ ôºñòî ëã õýéö èòïçòõôòýñòí õöôãöéçìýéõîòí õìñéôçìì.\" - çòåòôìö Ìòùôéñõ Ìì-ðïãèþìí, çéñéôãï¼ñºí èìôéîöòô óôéèóôì¿öì¿.",
				public="lawrence-lee-jr",
				events = 
				{
					"studio tv/lee2.jpg", 
					"zoom tv/lee2.jpg", 
					"interview tv/lee1.jpg", 
					"interview tv/lee1.jpg", 
					"interview tv/lee1.jpg", 
					"studio tv/lee1.jpg",
					"studio",
					"studio",
				}
			}	
		)
		addShow(newsOutro)
	end

	if isMissionCompleted("lee_computers") and not isMissionCompleted("lee_login") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Äéôëîã¿ îôãêã ñã óôéèóôì¿öìì \"Öìðìîãöº Ìì\".",
				ticker = "Ðôéõöùóñìî ñãñéõ ðãöéôìãï¼ñºí ùÿéôä ì õùðéï õîôºö¼õ¿ õ ½ïéîöôòññºð òäòôùèòåãñìéð. Ãéñéôãï¼ñºí èìôéîöòô Ìòùôéñõ Ìì-ðïãèþìí çòåòôìö, ýöò òñì òäñòå¿ö õìõöéðù äéëòóãõñòõöì ì óôéèóôì¿öìé åõîòôé åéôñéöõ¿ î ôãäòöé.",
				public = "lawrence-lee-jr",
				events = 
				{
					"studio", 
					"reporter tv/lee.jpg", 
					"studio tv/lee.jpg", 
					"interview tv/destroyed.jpg", 
					"studio tv/lee-in-office.jpg", 
					"zoom tv/lee-in-office.jpg", 
					"studio",
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial1, {image="tv/auction.jpg", top="Black River", middle="Classic car auction", bottom="  This Wednesday\nCall 555-188-2789"})
	end

	if isMissionCompleted("lee_login") and not isMissionCompleted("marina_demolish") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ãôãäìöéïì ñãñòõ¿ö òöåéöñºí ùèãô",
				ticker = "Â ½öì åºûòèñºé óôéèóôì¿öìé \"Öìðìîãöº Ìì\" õöãïò êéôöåòí éÿé òèñòí ãöãîì õ îôãêéí ìðùÿéõöåã. Áºïò óòåôéêèéñò ñéõîòï¼îò ëèãñìí ì óòûìÿéñò ñéõîòï¼îò ùõöôòíõöå ìë õìõöéðº äéëòóãõñòõöì åûòèã. Ðòïìüì¿ çòåòôìö, ýöò åëïòð ðòêéö äºö¼ õå¿ëãñ õ õòäºöìéð ñã óôòþïòí ñéèéïé, îòçèã äºïì ùîôãèéñº îòðó¼¾öéôº.",
				events = 
				{
					"studio", 
					"studio tv/lee-login4.jpg", 
					"studio tv/lee-login5.jpg", 
					"studio tv/lee-login6.jpg", 
					"zoom tv/lee-login4.jpg", 
					"zoom tv/lee-login5.jpg", 
					"zoom tv/lee-login6.jpg", 
					"studio", 
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/gubbgrill.ogg",
				image1 = "tv/ad-gubbgrill1.jpg",
				zoom1 = true,
				text1 = "Îòôðãï¼ñã¿ éèã",
				text2 = "Èã ñòôðãï¼ñù¾ üéñù",
				image2 = "tv/ad-gubbgrill2.jpg",
				text3 = "Çèéð ñã Èãóãèñòð óòôöù",
				text4 = "Èãîãêì õóéü. äï¾èò!",
				size1 = 18,
				size2 = 18,
				size3 = 18,
				size4 = 18,
				color1 = {r=1, g=0, b=0},
				color2 = {r=1, g=1, b=0},
				color3 = {r=1, g=0, b=0},
				color4 = {r=1, g=1, b=0},
			}	
		)
	end
	
	if isMissionCompleted("marina_demolish") and not isMissionCompleted("marina_cars") then
		addShow(mysteryIntro)
		addShow(mystery,
			{
				eventlength = 6,
				bgimage = "tv/mystery-eye.jpg",
				bgsound="tv/mystery2.ogg",
				bgzoom = 1,
				events = 
				{
					"title*4|Öìêìñã-óôìëôãî", 
					"Úéöºôé \"òîéãñõîìé\" ûìêìñº \nñã Èãóãèñòí Ðôìõöãñì. àöò óòóùï¿ôñºí îùôòôö \nòöèºûã åòö ùêé ðñòçò ïéö.*6|tv/mystery-cabinphoto.jpg", 
					"Îò, óò õïòåãð îãóìöãñã óòôöã Äêìðã Ä½çïìþã,\n ôãñ¼þé ëèéõ¼ äºïò ó¿ö¼ ûìêìñ.*8|tv/mystery-4cabins.png tv/mystery-5cabins.png", 
					"Íº ìëùýìïì åõé èòõöùóñºé ìõöòýñìîì.\nÎò ñìîãîìû èòîãëãöéï¼õöå õùÿéõöåòåãñì¿\nó¿öòí ûìêìñº ñãíöì ñé ùèãïòõ¼.*6|tv/mystery-document1.png tv/mystery-document2.png tv/mystery-document3.png tv/mystery-document4.png tv/mystery-document5.png tv/mystery-document6.png", 
					"Áéëèòîãëãöéï¼ñºé õïùûì åõé éÿé õùÿéõöåù¾ö.\nÏ ûìêìñé-óôìëôãîé...*6|tv/mystery-ghostcabin.png tv/mystery-questionmarks.png", 
					"outro*6|Îã õïéèù¾ÿéí ñéèéïé:\nìõîùõõöåò ìïì òõöãöîì\n ëãçôòäñòí êìëñì?"
				}
			}
		)
	end

	if lastCompleted == "marina_cars" then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ðòûìÿéñìé õöãôºû ãåöòðòäìïéí.",
				ticker = "Âýéôã åéýéôòð õ óôìõöãñì Âéõöóòíñö äºïì ùçñãñº èåã îïãõõìýéõîìû ãåöòðòäìï¿. \"Ôèãýã å óòõïéèñéé åôéð¿ ñé ñã ðòéí õöòôòñé.\" - çòåòôìö Ìòùôéñõ Ìì ðïãèþìí, îòöòôºí îùóìï ðãþìñº ñã ãùîüìòñé åõéçò ñéõîòï¼îò èñéí ñãëãè.",
				events = 
				{
					"studio", 
					"studio tv/lee-cars-intro.jpg", 
					"still tv/lee-cars-intro.jpg",
					"zoom tv/lee-cars1.jpg",
					"zoom tv/lee-cars2.jpg",
					"studio tv/lee-cars-intro.jpg",
				}
			}	
		)
		addShow(newsOutro)		
	end
	
	if lastCompleted == "marina_gps" then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ôîôãèéñº GPS-ùõöôòíõöåã",
				ticker = "Âýéôã åòôº óôòñìîïì å çãåãñ¼ ì ùñéõïì èòôòçìé ñãåìçãüìòññºé ùõöôòíõöåã GPS, óôìýìñìå ùÿéôä óôìõöãñì ì ñéõîòï¼îìð ïòèîãð. Ëãóìöãñ óòôöã Äêìð Ä½çïìþ çòåòôìö, ýöò å óòõïéèñéé åôéð¿ ñã óôìõöãñì óôòìëòþïã üéïã¿ õéôì¿ õïùýãéå åãñèãïìëðã ì îôãê õò åëïòðòð.",
				events = 
				{
					"studio", 
					"studio tv/marina-gps-intro.jpg", 
					"still tv/marina-gps-intro.jpg",
					"zoom tv/marina-gps1.jpg",
					"zoom tv/marina-gps2.jpg",
					"studio tv/marina-gps-intro.jpg", 
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/expensive-kitchenware.ogg",
				image1 = "tv/ad-knife1.jpg",
				zoom1 = true,
				text1 = "Ïõöôºé.",
				text2 = "Ðôòõöºé.",
				image2 = "tv/ad-knife2.jpg",
				text3 = "Äòôòçìé.",
				text4 = "Îòêì.",
				color1= {r=0, g=0, b=0},
				color2= {r=0, g=0, b=0},
				color3= {r=0, g=0, b=0},
				color4= {r=0, g=0, b=0},
			}	
		)
	end

	if lastCompleted == "mansion_pool" then		
		addShow(newsIntro)
		addShow(news,
			{
				title = "Âìïïã Ãòôèòñã óòèåéôçïãõ¼ åãñèãïìëðù.",
				ticker = "Âéôñùåþìõ¼ ìë èéïòåòí óòéëèîì, çòõóòèìñ Âù òäñãôùêìï ñéõîòï¼îò õåòìû üéññºû ãåöòðòäìïéí åºäôòþéññºðì å òîéãñ õéçòèñ¿ ùöôòð. Ïñ çòåòôìö, ýöò óòñ¿öì¿ ñé ìðééö, ëãýéð îòðù-öò ½öò èéïãö¼, ì ñãëºåãéö ½öò öôãçéèìéí.",
				events = 
				{
					"studio", 
					"studio tv/carwash-intro.jpg", 
					"still tv/carwash-intro.jpg",
					"zoom tv/carwash1.jpg",
					"zoom tv/carwash2.jpg",
					"studio",  
					"studio",
				}
			}	
		)
	end	

	if lastCompleted == "lee_safe" then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Âóéýãöï¿¾ÿìí åëïòð å Ìì",
				ticker = "Ðôòþïòí ñòý¼¾ å ûìðìýéõîòð îòðóïéîõé Ìì óôòìëòþéï éÿé òèìñ åóéýãöï¿¾ÿìí åëïòð, å ôéëùï¼öãöé îòöòôòçò äºïò óòåôéêèéñò ìðùÿéõöåò, ã óôéõöùóñìîì, óò èãññºð óòïìüìì, ùþïì õ ö¿êéïºð òûôãññºð òäòôùèòåãñìéð. \"Úöò óôòìõûòèìö õ Ìéîîéïé, ñùêñº ïì åãð ëãðîì èï¿ åãþìû ëãðîòå å ñãõöò¿ÿéé åôéð¿!?\" çòåòôìö çéñéôãï¼ñºí èìôéîöòô Ìòùôéñõ Ìì-ðïãèþìí.",
				events = 
				{
					"studio", 
					"studio tv/lee-safe1.jpg", 
					"still tv/lee-safe1.jpg", 
					"zoom tv/lee-safe2.jpg", 
					"studio tv/lee-safe2.jpg", 
					"still tv/lee-safe3.jpg", 
					"studio tv/lee-safe3.jpg", 
				}
			}	
		)
	end

	if isMissionCompleted("marina_cars") and not isMissionCompleted("lee_tower") then
		addShow(news,
			{
				title = "Áãþñ¿ Ìì - 75-ïéöìé",
				ticker = "Â ½öì åºûòèñºé îòðóãñì¿ Ìì Öéðìîãïõ óôãëèñùéö 75-ïéöñ¾¾ çòèòåÿìñù ëãåéôþéñì¿ õöôòìöéï¼õöåã ëñãðéñìöòí äãþñì Ìì. Ðòõöôòéññã¿ Ìòùôéñõòð Ìì-õöãôþìð, äãþñ¿ ìðééö åóéýãöï¿¾ÿù¾ åºõòöù 22 ðéöôã ì äºïã óòõöôòéñã óòýöì ìë 3000 îìôóìýéí. Ò åéôûñéçò ½öãêã òöîôºåãéöõ¿ ùèìåìöéï¼ñºí åìè ñã òîôéõöñòõöì, åîï¾ýã¿ óïòöìñù ì ñòåù¾ ½ïéîöôòõöãñüì¾. Ðòõïé ëãåéôþéñì¿ õöôòìöéï¼õöåã òñã äºïã åîï¾ýéñã å äôéñè Ìì Öéðìîãïõ, õìðåòïìëìôù¿ ùõóéû îòðóãñìì.",
				public = "lawrence-lee-jr",
				events = 
				{
					"studio", 
					"studio tv/towerdocu-3.jpg", 
					"reporter tv/towerdocu-bg.jpg", 
					"studio tv/lee-grandfather.jpg", 
					"interview tv/towerdocu-bg.jpg", 
					"zoom tv/towerdocu-1.jpg",
					"zoom tv/towerdocu-6.jpg",
					"zoom tv/towerdocu-5.jpg",
					"zoom tv/towerdocu-9.jpg", 
					"studio tv/lee-chemicals-logo.jpg",
					"studio",
				}
			}	
		)
		addShow(newsOutro)
	end

	if isMissionCompleted("lee_tower") and not isMissionCompleted("mansion_art") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Áãþñ¿ Ìì ôùûñùïã",
				ticker = "Èñãðéñìöã¿ äãþñ¿ Ìì óôéèóôì¿öì¿ \"Öìðìîãöº Ìì\" äºïã õñéõéñã ñéìëåéõöñºðì ëïòùðºþïéññìîãðì. Ðòëòôñòé èé¿ñìé óôòìõûòèìö óô¿ðò óéôéè 75-ïéöìéð äãþñì. Òöò¿ ñã òäïòðîãû, Ìòùôéñõ Ìì-ðïãèþìí åºôãêãéö çòôé ì çñéå. \"àöì óòïòùðñºé ñéãñèéôöãï¼üº ñé ëñã¾ö, ýöò ìû êèéö! Àöãîòåãö¼ õéôèüé ì èùþù ðòéçò óôéèóôì¿öì¿! Íòéí õéð¼ì!!!\" - õîãëãï Ìì. Ïñ ¿åñò õìï¼ñò ôãõõöôòéñ.",
				public="lawrence-lee-jr",
				events = 
				{
					"zoom tv/lee-tower-intro.jpg", 
					"studio tv/lee-tower-intro.jpg", 
					"studio tv/lee-tower1.jpg", 
					"zoom tv/lee-tower2.jpg", 
					"zoom tv/lee-tower3.jpg", 
					"zoom tv/lee-tower4.jpg", 
					"interview tv/lee-tower-bg.jpg", 
					"studio tv/lee-tower-bg.jpg", 
					"studio", 
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/parade.ogg",
				text1 = "Ðôãëèñìîì å Ìéîîéïé!",
				image1 = "tv/ad-parade1.jpg",
				text2 = "Ðãôãè çåãôèìì",
				image2 = "tv/ad-parade2.jpg",
				zoom2 = true,
				text3 = "Íùëºîã ì úéíéôåéôî!",
				size4 = 20,
				text4 = "Âõöôéýã å ÓÙ àåéôöìèéõ!",
			}	
		)
	end

	if lastCompleted == "marina_tools" then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Éñõöôùðéñöº, óôòóãåþìé õ óôìõöãñì.",
				ticker = "Îéõîòï¼îò èòôòçìû ìñõöôùðéñöòå óôòóãïì ìë ñòåòçò èòîã, óòõöôòéññòçò ñã óôìõöãñì. Ô óòïìüìì èò õìû óòô ñéö óòèòëôéåãéðòçò.",
				events = 
				{
					"studio tv/tools-intro.jpg", 
					"zoom tv/tools-intro.jpg",
					"studio tv/tools1.jpg", 
					"studio tv/tools2.jpg", 
					"studio", 
				}
			}	
		)
	end
	
	if isMissionCompleted("mansion_art") and not isMissionCompleted("marina_art_back") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ðôìäïìêãéöõ¿ çôòëã",
				ticker = "Ðôìäïìêãéöõ¿ õìï¼ñã¿ çôòëã, îòöòôã¿, îãî òêìèãéöõ¿, òäôùþìöõ¿ ñã óòäéôéê¼é õéçòèñ¿ ñòý¼¾. Íéöéòôòïòç Òãôã Îìðäùõõòñ ôéîòðéñèùéö åõéð òõöãåãö¼õ¿ èòðã ì èéôêãö¼õ¿ óòèãï¼þé òö òîòñ.",
				events = 
				{
					"studio", 
					"studio tv/weather3.jpg",
					"still tv/weather3.jpg", 
					"still tv/weather6.jpg", 
					"studio tv/weather6.jpg",
					"studio tv/weather6.jpg",
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/bayran.ogg",
				image1 = "tv/ad-bayrans1.jpg",
				zoom1 = true,
				text1 = "Ëòçèã åº ìÿéöé",
				text2 = "õåéöïòé äùèùÿéé",
				image2 = "tv/ad-bayrans2.jpg",
				text3 = "Âºäìôãí",
				color3= {r=0, g=0, b=0},
				text4 = "Áãíôãñõ",
				size4 = 42,
				color4= {r=0, g=0, b=0},
			}	
		)
	end

	if lastCompleted == "mansion_fraud" then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ûùð ñã åìïïé Ãòôèòñã",
				ticker = "Ãôòðîìé ëåùîì åòëïé åìïïº Ãòôèòñã. \"Òìôéñº óôòõöò ôãëôºåãïìõ¼!\", ôãõõîãëºåãéö çòñÿìî LCN. Ãòõóòèìñ Âù ùåéô¿éö, ýöò äéõóòîòìö¼õ¿ ñé ò ýéð: \"àöò öìóìýñò èï¿ ï¾èéí, îòöòôºé ñéñãåìè¿ö çòñîì.\"",
				events = 
				{
					"zoom tv/fraud4.jpg",
					"still tv/fraud2.jpg",
					"studio tv/fraud2.jpg",
					"zoom tv/fraud1.jpg",
					"studio tv/fraud1.jpg",
					"studio tv/fraud3.jpg",
					"studio",
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/bluetide.ogg",
				image1 = "tv/ad-bluetide1.jpg",
				image2 = "tv/ad-bluetide3.jpg",
				zoom1 = true,
				text1 = "BlueTide",
				size1 = 36,
				text2 = "àöò õöìï¼ êìëñì",
			}	
		)
	end

	if isMissionCompleted("marina_art_back") and not isMissionCompleted("caveisland_computers") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ðòôö óòåôéêèéñ ðòïñì¿ðì",
				ticker = "Îéõîòï¼îò ëèãñìí ñã óôìõöãñì Âéõöóòíñö äºïì óòåôéêèéñº åò åôéð¿ çôòëº óôòþïòí ñòý¼¾. \"àöò ýùèò, ýöò ëèãñì¿ åõé éÿé õöò¿ö. Íº åìèìð õïéèº óòêãôã, ñò õìï¼ñºí èòêè¼, èòïêñò äºö¼, óòöùþìï éçò!\" çòåòôìö ñãýãï¼ñìî óòôöã Äêìð Ä½çïìþ.",
				events = 
				{
					"studio tv/thunder1.jpg", 
					"zoom tv/thunder4.jpg", 
					"zoom tv/thunder5.jpg", 
					"zoom tv/thunder2.jpg", 
					"studio tv/thunder2.jpg", 
					"zoom tv/thunder6.jpg",
					"zoom tv/thunder3.jpg",
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/russian-caviar.ogg",
				image1 = "tv/ad-caviar1.jpg",
				zoom1 = true,
				text1 = "Öòöìöé óôòìëåéõöì \n      åóéýãöïéñìé?",
				text2 = "Öòöìöé äïéõñùö¼ \n      ñãïìýñºðì?",
				image2 = "tv/ad-caviar2.jpg",
				text3 = "Ñùõõîã¿ ìîôã",
				color3= {r=1, g=0, b=0},
				text4 = "Öòôòþò õòýéöãéöõ¿\nõ ôºäñºð äìëñéõòð",
			}	
		)
	end

	if isMissionCompleted("caveisland_computers") and not isMissionCompleted("mansion_safe") then
		addShow(diyIntro)
		addShow(mystery,
			{
				eventlength = 6,
				bgimage = "tv/black.jpg",
				bgsound="tv/diy.ogg",
				bgzoom = 0,
				events = 
				{
					"title*4|Ðòôöãöìåñºí\nåòèòñéóôòñìüãéðºí\nõãôãí", 
					"Äòêè¼ ï¼éö îãî ìë åéèôã.\nÉ öåò¿ üéññã¿ ôºäã-ðéý\nýùåõöåìöéï¼ñã î åòèé?*6|tv/waterproof-rain.jpg tv/waterproof-precious.png", 
					"É ù öéä¿ ñéö îôºöòçò çôùëòåìîã?\n Ììþ¼ òöîôºöºí çôùëòåìî ì ñéõîòï¼îò õöòïòå.*9|tv/w1.jpg tv/w3.jpg tv/w4.jpg", 
					"Ðôò¿åìå õðéîãïîù, öº ðòêéþ¼ óòõöôòìö¼\nõéäé îôãõìåºí ðòäìï¼ñºí õãôãí!*6|tv/w5.jpg tv/w5.jpg", 
					"Éïì ù öéä¿ éõö¼ èôùçòí ðãöéôìãï,\nïéêãÿìí åòîôùç, ìë ýéçò öº ðòêéþ¼ õöôòìö¼?*16|tv/white.jpg tv/w6s.png tv/w7s.png tv/w8s.png tv/w9s.png tv/w10s.png tv/w11s.png tv/w12s.png tv/w13s.png tv/w14s.png",
					"Ò ûòôòþìðì ìñõöôùðéñöãðì ì ñãåºîãðì åãþã\nôºäã-ðéý ðòêéö äéëòóãõñò óùöéþéõöåòåãö¼.*5| tv/waterproof-precious.png", 
					"outro*6|Â õïéèù¾ÿéð åºóùõîé:\nÒöéñã, ñò ñéö èºôº?\nÉçôº õò åëôºåýãöîòí!"
				}
			}
		)
	end

	if isMissionCompleted("mansion_safe") and not isMissionCompleted("lee_powerplant") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ñòõö åãñèãïìëðã",
				ticker = "Â òîôùçé Ìéîéïï¼ óôòìëòþéï éÿé òèìñ åëïòð. Îã ½öòö ôãë êéôöåòí õöãï Ãòôèòñ Âù. Ðôéõöùóñìîãð ùèãïòõ¼ ùîôãõö¼ ñéõîòï¼îò ïìýñºû õéíúòå ðìõöéôã Âù. \"â ñé ëñã¾, óòýéðù òñì ùîôãïì õéíúº. Ïýéñ¼ ðãïòåéôò¿öñò, ýöò òñì õðòçùö ìû òöîôºö¼. àöò õãðºé õòåôéðéññºé õéíúº Quilez\", - õîãëãï Ãòôèòñ å ìñöéôå¼¾.",
				events = 
				{
					"studio", 
					"studio",
					"studio tv/gordon-office.jpg", 
					"studio tv/mansion-safe2.jpg", 
					"zoom tv/mansion-safe2.jpg", 
					"still tv/mansion-safe1.jpg", 
					"studio tv/mansion-safe1.jpg", 
					"studio",
				}
			}	
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/expensive-kitchenware.ogg",
				image1 = "tv/ad-foodprocessor1.jpg",
				zoom1 = true,
				text1 = "Íìîõùíöé.",
				text2 = "Òðéþìåãíöé.",
				image2 = "tv/ad-foodprocessor2.jpg",
				text3 = "Äòôòçòí.",
				text4 = "Ëùûòññºí îòðäãíñ.",
				color1= {r=0, g=0, b=0},
				color2= {r=0, g=0, b=0},
				color3= {r=0, g=0, b=0},
				color4= {r=0, g=0, b=0},
			}	
		)
	end

	if lastCompleted == "caveisland_propane" then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ãôòðîìé åëôºåº ñã ãôûìóéïãçé",
				ticker = "Âýéôã åéýéôòð óòõöùóìïò ñéõîòï¼îò õòòäÿéñìí ò çôòðîìû åëôºåãû ñã ãôûìóéïãçé Ìéîîéï¼. Áéôéçòåã¿ òûôãñã óôòýéõºåãéö ðéõöñòõö¼, ýöòäº ïòîãïìëòåãö¼ þùð. Ïîéãñòïòç èòîöòô Ð¼éô Óôòþ çòåòôìö, ýöò ½öò ðòçïì äºö¼ óòèåòèñºé çãëòåºé îãôðãñº, åºäôãõºåã¾ÿìé çòô¿ýìé çãëº ìë-ëã óïòûòí óòçòèº.",
				public = "troch",
				events = 
				{
					"studio", 
					"studio tv/propane2.jpg", 
					"studio tv/propane1.jpg", 
					"zoom tv/propane1.jpg", 
					"interview tv/propane3.jpg", 
					"interview tv/propane3.jpg", 
					"studio", 
				}
			}	
		)
		addShow(newsOutro)
	end

	if isMissionCompleted("lee_powerplant") and not isMissionCompleted("caveisland_dishes") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ðôòôºå èãðäº åòèòûôãñìïìÿã",
				ticker = "Ðòõïé óôòôºåã èãðäº å ðùñìüìóãïìöéöé Ìéîîéïïé äºï ëãúìîõìôòåãñ åñéëãóñºí óòè¹éð ùôòåñ¿ åòèº. Àïìþã Ëìñ ìë îïùäã ôéîôéãüìòññòí ôºäãïîì Ìéîîéïïé ùöåéôêèãéö, ýöò ëãöòóïéññºé ùýãõöîì óòèóãèã¾ö óòè èéíõöåìé èéíõöåù¾ÿìû ôãëôéþéñìí ñã ôºäãïîù å Ëåìöõûãïïòù.",
				public="keen",
				events = 
				{
					"studio", 
					"studio tv/dam3.jpg", 
					"zoom tv/dam1.jpg", 
					"interview tv/dam2.jpg", 
					"studio tv/dam2.jpg",
					"studio",
				}
			}	
		)
		addShow(newsOutro)
	end

	if isMissionCompleted("caveisland_dishes") and not isMissionCompleted("lee_flooding") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Îòåòé óòîôºöìé õóùöñìîòåºð ÓÂ",
				ticker = "Ò õéçòèñ¿þñéçò ùöôã ô¿è çôãêèãñ õòòäÿìïì, ýöò öéóéô¼ òñì ðòçùö óòïùýãö¼ ôãñéé ñéèòõöùóñºé öéïéóôòçôãððº. \"Îãîòñéü-öò ¿ ðòçù óòõðòöôéö¼ óô¿ðù¾ öôãñõï¿üì¾ \"Ìùýþìé þéú-óòåãôã Ãôéñïãñèìì\", - çòåòôìö ðéõöñºí ï¾äìöéï¼ éèº Ãô½ð Ûöéïòó.",
				public="stolop",
				events = 
				{
					"studio", 
					"studio tv/satelite2.jpg",
					"still tv/satelite2.jpg",
					"interview tv/satelite1.jpg", 
					"interview tv/satelite1.jpg", 
					"studio tv/satelite1.jpg", 
					"studio tv/ntc.jpg", 
					"studio",
				}
			}
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/bluetide.ogg",
				image1 = "tv/ad-bluetide2.jpg",
				text2 = "àöò õöìï¼ êìëñì",
				image2 = "tv/ad-bluetide4.jpg",
				zoom2 = true,
				text3 = "BlueTide Òùóéô Òìï¼ñºí",
				text4 = "òçôãñìýéññºí öìôãê - $75",
			}	
		)
	end
	if isMissionCompleted("lee_flooding") and not isMissionCompleted("frustrum_chase") then
		addShow(commercial,
			{
				audio = "tv/bluetide.ogg",
				image1 = "tv/ad-bluetide2.jpg",
				text2 = "àöò õöìï¼ êìëñì",
				image2 = "tv/ad-bluetide4.jpg",
				zoom2 = true,
				text3 = "BlueTide Òùóéô Òìï¼ñºí",
				text4 = "òçôãñìýéññºí öìôãê - $75",
			}	
		)
		addShow(commercial,
			{
				audio = "tv/expensive-kitchenware.ogg",
				image1 = "tv/ad-foodprocessor1.jpg",
				zoom1 = true,
				text1 = "Íìîõùíöé.",
				text2 = "Òðéþìåãíöé.",
				image2 = "tv/ad-foodprocessor2.jpg",
				text3 = "Äòôòçòí.",
				text4 = "Ëùûòññºí îòðäãíñ.",
				color1= {r=0, g=0, b=0},
				color2= {r=0, g=0, b=0},
				color3= {r=0, g=0, b=0},
				color4= {r=0, g=0, b=0},
			}	
		)
	end

	--------------------------------------------------------
	--------------------------------------------------------
	--------------------------------------------------------
	---
	--				PART 2
	---
	--------------------------------------------------------
	--------------------------------------------------------
	--------------------------------------------------------

	if isMissionCompleted("frustrum_chase") and not isMissionCompleted("factory_espionage") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ëòðóãñì¿ Ìì Öéðìîãïë åºåéèéñã ìë ½îõóïùãöãüìì",
				ticker = "Ðòõïé ãôéõöã Ìòùôéñõã Ìì-ðïãèþéçò ½öìð ïéöòð îòðóãñì¿ Ìì Öéðìîãïõ óòèãïã ëã¿åïéñìé ò äãñîôòöõöåé, ì ìõöòôìýéõîìí ûìðìýéõîìí ëãåòè äºï åºåéèéñ ìë ½îõóïùãöãüìì. Â ñãõöò¿ÿéé åôéð¿ óïãñìôùéöõ¿ îòñöôòïìôùéðºí õñòõ ëãåòèã, ã ùýãõöòî åºõöãåïéñ ñã óôòèãêù.",
				events = 
				{
					"studio tv/lee-convicted3.jpg", 
					"studio tv/lee-demolish3.jpg",
					"zoom tv/lee-demolish3.jpg",
					"still tv/lee-demolish2.jpg",
					"studio tv/lee-demolish1.jpg",
					"studio tv/lee-for-sale1.jpg",
					"zoom tv/lee-for-sale1.jpg",
					"still tv/lee-for-sale1.jpg",
				}
			}
		)
		addShow(newsOutro)
	end	

	if isMissionCompleted("factory_espionage") and not isMissionCompleted("caveisland_ingredients") then
		addShow(newsIntro)
		addShow(news,
			{
				title = "Ãòôèòñ Âù óòîùóãéö ùýãõöòî Ìì",
				ticker = 'Ãòõóòèìñ Âù òä¹¿åìï õéçòèñ¿ ò öòð, ýöò òñ äéôéö å õåòì ôùîì ëéðï¾ äºåþéçò ëãåòèã Ìì Öéðìîãïõ. "Íñé, åºôòõþéðù å Ìéîéïïé, ö¿êéïò åìèéö¼, îãî ùûòè¿ö ½öì ëñãîòåºé ëèãñì¿. Îò, ¿ èùðã¾, ýöò ðòì ñòåºé óïãñº óòèãô¿ö ñãþéðù õòòäÿéõöåù ýöò-öò éÿé äòïéé ëãóòðìñã¾ÿééõ¿", - çòåòôìö ç-ñ Âù.',
				public = "gordon-office-solo",
				reporter = "",
				events = 
				{
					"studio",
					"studio tv/evertides1.jpg",
					"interview tv/evertides-breakin2.jpg",
					"interview tv/evertides-breakin2.jpg",
					"still tv/gordon-buys-lee1.jpg",
					"still tv/gordon-buys-lee2.jpg",
					"zoom tv/gordon-buys-lee2.jpg",
					"studio tv/gordon-buys-lee2.jpg",
					"studio",
				}
			}
		)
		addShow(newsOutro)
	end	

	if isMissionCompleted("caveisland_ingredients") and not isMissionCompleted("frustrum_tornado") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Õôùõöôùð ½åãîùìôòåãñ',
				ticker = 'Â ñãõöò¿ÿéé åôéð¿ å Ìéîîéïïé ñãäï¾èã¾öõ¿ ñéòäºýñò õìï¼ñºé åéöôº èï¿ ½öòçò åôéðéñì çòèã. Ðéôéèãéð õïòåò Òãôé Îìðäùõõòñ. "Ûöòôð óôìäïìêãéöõ¿ î Õôùõöôùðù. Ïêìèãéöõ¿ óò¿åïéñìé öòôñãèò". Çìöéïì äºïì ½åãîùìôòåãñº.',
				events = 
				{
					"studio tv/frustrum-evacuated1.jpg", 
					"studio tv/frustrum-evacuated2.jpg",
					"still tv/nimbuson-tornado.jpg", 
					"studio tv/nimbuson-tornado.jpg",
					"studio",
					"studio",
				}
			}
		)
		addShow(news,
			{
				title = 'Äéúìüìö BlueTide',
				ticker = 'Òóôòõ ñã óòóùï¿ôñºí ½ñéôçéöìýéõîìí ñãóìöòî ôéëîò åòëôòõ. Â ñãõöò¿ÿéé åôéð¿ å ñéîòöòôºû ðãçãëìñãû éçò ñéö å ñãïìýìì. Óéð åôéðéñéð çòåòô¿ö ò óôòäïéðãû õò ëèòôòå¼éð. Òýìöã¾ö, ýöò òñ åºëºåãéö óôìåºîãñìé. Íº óòóºöãéðõ¿ õå¿ëãö¼õ¿ õ Áï¾Óãíè Ëòôó. èï¿ óòïùýéñì¿ óò¿õñéñìí.',
				events = 
				{
					"studio tv/bluetide-shortage6.jpg",
					"studio tv/bluetide-shortage2.jpg",
					"zoom tv/bluetide-shortage3.jpg",
					"still tv/bluetide-shortage4.jpg",
					"zoom tv/bluetide-shortage4.jpg",
					"studio tv/bluetide-shortage5.jpg",
					"studio",
				}
			}
		)
		addShow(newsOutro)
	end	

	if isMissionCompleted("frustrum_tornado") and not isMissionCompleted("mall_shipping") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Óòôñãèò òäôùþìïõ¿ Õôùõöôùð',
				ticker = 'Òòòäÿãéöõ¿ òä òçôòðñòð ùÿéôäé, ñãñéõéññòð öòôñãèò åò Õôùõöôùðé. "àöò ûùèþéé, ýöò ¿\ åìèéï å Ìéîéïïé!". Áïãçòèãô¿ ôãññéí ½åãîùãüìì ñìîöò ñé óòõöôãèãï.',
				events = 
				{
					"studio tv/tornado-damage2.jpg",
					"studio tv/tornado-damage3.jpg",
					"reporter tv/tornado-damage1.jpg",
					"studio tv/tornado-damage4.jpg",
					"studio tv/tornado-damage5.jpg",
				}
			}
		)
		addShow(newsOutro)
	end

	if isMissionCompleted("mall_shipping") and not isMissionCompleted("carib_alarm") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Âëïòð å àåéôöìèéõ',
				ticker = 'Â öòôçòåòð üéñöôé àåéôöìèéõ óôòìëòþéï åëïòð. \"Ô ñãõ äºïì ñéîòöòôºé... Ðôòäïéðº õ óôéêñìð åºõþìð ôùîòåòèõöåòð. Îò òèñìð ìë ðòìû óéôåºû èéíõöåìí ¿åï¿éöõ¿ ùçïùäïéñìé ñãþéçò õöôãöéçìýéõîòçò óãôöñéôõöåã õ òûôãññòí îòðóãñìéí Quilez\", - çòåòôìö ñéèãåñò ñãëñãýéññºí ðéñéèêéô öòôçòåòçò üéñöôã àôìñ Ãôéçòôìùõ.',
				public = "erin-gregorius",
				events = 
				{
					"studio tv/evertides-breakin1.jpg",
					"still tv/evertides-breakin1.jpg",
					"interview tv/evertides-breakin2.jpg",
					"interview tv/evertides-breakin2.jpg",
					"still tv/evertides-breakin3.jpg",
					"zoom tv/evertides-breakin3.jpg",
					"studio tv/evertides-breakin3.jpg",
				}
			}
		)		
		addShow(newsOutro)
		--new song
		addShow(commercial,
			{
				audio = "tv/bayran.ogg",
				image1 = "tv/sunnymax2.jpg",
				zoom1 = true,
				zoom2 = true,
				text1 = "Ðôéèõöãå¼ õòïñüé",
				text2 = "àïéîöôìýéõîòé",
				image2 = "tv/sunnymax3.jpg",
				text3 = "Òòï¿ôìí SunnyMax",
				text4 = "Ëãî ñãõöò¿ÿéé. Ðòýöì.",
				color1= {r=214/255, g=208/255, b=53/255},
				color2= {r=214/255, g=208/255, b=53/255},
				color3= {r=214/255, g=208/255, b=53/255},
				color4= {r=214/255, g=208/255, b=53/255},
			}	
		)
	end	

	--more images of woonderland
	if isMissionCompleted("carib_alarm") and not isMissionCompleted("frustrum_vehicle") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Èãõöô¿åþìí çôùëòåìî',
				ticker = "Òéçòèñ¿ ìë-ëã óïòûòí óòçòèº å îãñãïé Ìéîîéïïé ëãõöô¿ï åòéññºí çôùëòåìî, îòöòôºí èòõöãåï¿ïõ¿ èï¿ òûôãñº èòðã Ìéîîéïïé.\"Íº ôãäòöãïì åéõ¼ èéñ¼, ñò ñìýéçò ñé èòäìïìõ¼.\", - çòåòôìö Ïïìåéô Õùñîé ìë òûôãñº èòðã Ìéîîéïïé. Ïñì óôòèòïêãö ôãäòöù ëãåöôã.",
				public = "oliver-funke",
				events = 
				{
					"studio",
					"studio tv/stuck-in-muck1.jpg",
					"still tv/stuck-in-muck1.jpg",
					"interview tv/truck-missing2.jpg",
					"still tv/stuck-in-muck1.jpg",
					"zoom tv/stuck-in-muck1.jpg",
					"still tv/stuck-in-muck2.jpg",
					"zoom tv/stuck-in-muck2.jpg",
					"studio tv/stuck-in-muck2.jpg",
					"studio",
				}
			}
		)	
		addShow(news,
			{
				title = 'Ïöîôºöìé ñòåòçò óãôîã',
				ticker = "Ãòôèòñ Âù òöîôòéö óãôî \"Ãòñîì Âùñèéôïéñè\" î óôãëèñìîù. \"àöòö óôòéîö äïìëòî ðòéðù õéôèüù. Ìéîéïïé ñé ûåãöãïò ðéõöã, çèé ðòïòèºé ï¾èì ðòçïì äº õòäôãö¼õ¿ åòîôùç õåòéçò ìñöéôéõã î çòñîãð, óòåéõéïìö¼õ¿ ì óòçòåòôìö¼ ò õåòìû ðéõöñºû çéôò¿û. Èèéõ¼ äùèùö çòñòýñºé ãööôãîüìòñº, ðòöòüìîïéöñã¿ îãôùõéï¼ ì èãêé ïòèîì-ïéäéèì!\", - çòåòôìö ç-ñ Âù.",
				events = 
				{
					"still tv/visit-woonderland2.jpg",
					"still tv/visit-woonderland3.jpg",
					"zoom tv/visit-woonderland3.jpg",
					"still tv/visit-woonderland1.jpg",
					"still tv/visit-woonderland4.jpg",
					"zoom tv/visit-woonderland4.jpg",
				}
			}
		)
		addShow(newsOutro)
	end	

	if isMissionCompleted("frustrum_vehicle") and not isMissionCompleted("mall_radiolink") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Ðôòóãêã åòéññòçò çôùëòåìîã',
				ticker = "Ãôùëòåìî, ëãõöô¿åþìí å îãñãïé Õôùõöôùð, öãìñõöåéññºð òäôãëòð ìõýéë õéçòèñ¿ ùöôòð. \"Åõö¼ óòèòëôéñìé, ýöò òñ ùóãï å îãñãï. Ðôìûòèìöõ¿ óôòåéô¿ö¼ éçò åéõ¼\", - çòåòôìö Ïïìåéô Õùñîé ìë Îãüìòñãï¼ñòí çåãôèìì.",
				public = "oliver-funke",
				events = 
				{
					"studio",
					"studio tv/truck-missing1.jpg",
					"still tv/truck-missing1.jpg",
					"interview tv/truck-missing2.jpg",
					"zoom tv/truck-missing1.jpg",
					"studio tv/truck-missing1.jpg",
				}
			}
		)	
		addShow(newsOutro)
		--new song
		addShow(commercial,
			{
				audio = "tv/bayran.ogg",
				image1 = "tv/evertides-christmas1.jpg",
				zoom1 = true,
				zoom2 = true,
				text1 = "Çèéþ¼ óôãëèñìî?",
				text2 = "Íº öòêé!",
				image2 = "tv/evertides-christmas2.jpg",
				text3 = "Ðôòñìîñìõ¼ èùûòð",
				text4 = "Â ÓÙ Evertides Mall!",
				color2= {r=169/255, g=57/255, b=62/255},
				color1= {r=62/255, g=149/255, b=62/255},
				color4= {r=169/255, g=57/255, b=62/255},
				color3= {r=62/255, g=149/255, b=62/255},
			}	
		)
	end	

	if isMissionCompleted("mall_radiolink") and not isMissionCompleted("factory_robot") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'àåéôöìèéõ óòõöôãèãï òö åãñèãïìëðã',
				ticker = "Óòôçòåºí üéñöô õöãï òä¹éîöòð õìï¼ñòçò åãñèãïìëðã. Îéõðòöô¿ ñã öò, ýöò äòï¼þã¿ ýãõö¼ ëèãñì¿ äºïã õñéõéñã, ñé äºïò ëãôéçìõöôìôòåãñò ñì òèñòçò õïùýã¿ îôãêì åéÿéí. \"Â ñãõöò¿ÿéé åôéð¿ åõé óôòèãéöõ¿, óòõîòï¼îù öòôçòåºí üéñöô èòïêéñ äºö¼ ëãîôºö ñã ôéðòñö\" çòåòôìö ðéñéèêéô öòôçòåòçò üéñöôã àôìñ Ãôéçòôìùõ.",
				public = "erin-gregorius",
				reporter = "",
				events = 
				{
					"studio tv/evertides-vandals1.jpg",
					"still tv/evertides-vandals1.jpg",
					"studio tv/evertides-vandals1.jpg",
					"studio tv/evertides-vandals2.jpg",
					"interview tv/evertides-vandals1.jpg",
					"still tv/evertides-vandals2.jpg",
					"studio tv/evertides-vandals2.jpg",
					"studio tv/evertides-vandals3.jpg",
					"still tv/evertides-vandals3.jpg",
					"zoom tv/evertides-vandals3.jpg",
				}
			}
		)
		addShow(newsOutro)
		--new song
		addShow(commercial,
			{
				audio = "tv/bayran.ogg",
				image1 = "tv/visit-woonderland3.jpg",
				zoom1 = true,
				zoom2 = true,
				text1 = "Òîòôòõö¼, ãëãôö, åéõéï¼é!",
				text2 = "Ãôãñèìòëñòé òöîôºöìé!\nÂôùð!",
				image2 = "tv/visit-woonderland4.jpg",
				text3 = "Ðòäãïùíöé õéä¿,",
				text4 = "Ðòõéöìöé Âùñèéôïéñè!",
				color1= {r=149/255, g=57/255, b=62/255},
				color2= {r=196/255, g=196/255, b=196/255},
				color3= {r=149/255, g=57/255, b=62/255},
				color4= {r=196/255, g=196/255, b=196/255},
			}	
		)
	end	

	if lastCompleted == "lee_woonderland" then
		addShow(news,
			{
				title = 'Ãòôèòñ Âù äãñîôòö',
				ticker = "Ì¾äìöéï¼ çòñòî ì äºåþìí ðìïïìòñéô Ãòôèòñ Âù óòèãï õéçòèñ¿ ëã¿åïéñìé ò ïìýñòð äãñîôòöõöåé óòõïé öòçò, îãî éçò çòñòýñºí îòðóïéîõ Âùñèéôïéñè äºï óòèåéôçñùö åãñèãïìëðù ñéëãèòïçò èò öòôêéõöåéññòçò òöîôºöì¿. Ììîåìèãöòô ìÿéö ñòåòçò åïãèéï¼üã, ñò óòîã ñé ñãþéï êéïã¾ÿìû.",
				events = 
				{
					"studio",
					"studio tv/woonderland-vandals1.jpg",
					"studio tv/woonderland-vandals2.jpg",
					"studio tv/woonderland-vandals3.jpg",
					"studio tv/woonderland-vandals4.jpg",
				}
			}
		)	
	end

	if isMissionCompleted("factory_robot") and not isMissionCompleted("factory_explosive") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Âòëðòêñã¿ óéôéèòëìôòåîã BlueTide',
				ticker = "Òéçòèñ¿ ùöôòð óòèôòõöòî ìë Õôùõöôùðã äºï ñãíèéñ äéë õòëñãñì¿ å òîôùêéñìì äòï¼þòçò îòïìýéõöåã äãñòî BlueTide. Íéèìüìñõîìé ½îõóéôöº éÿé òüéñìåã¾ö õìöùãüì¾, ñò ï¾èì ùêé óôòöéõöù¾ö, öôéäù¿ ëãóôéöìö¼ óòóùï¿ôñºí ½ñéôçéöìýéõîìí ñãóìöòî.",
				events = 
				{
					"studio",
					"studio tv/teenager1.jpg",
					"still tv/teenager1.jpg",
					"studio tv/teenager1.jpg",
					"studio tv/teenager3.jpg",
					"zoom tv/teenager4.jpg",
					"studio tv/teenager4.jpg",
				}
			}
		)
		addShow(newsOutro)
		addShow(commercial,
			{
				audio = "tv/bayran.ogg",
				image1 = "tv/robot-ad2.jpg",
				zoom1 = true,
				text1 = "Ô åãõ éõö¼ 20 õéîùñè...",
				image2 = "tv/robot-ad1.jpg",
				text3 = "Ðòïùýìö¼ 10%\nõîìèîù ñã åãþù",
				text4 = "ñòåù¾ ðòèéï¼\nQuilez 245!",
				color1= {r=149/255, g=40/255, b=40/255},
				color3= {r=1, g=1, b=1},
				color4= {r=1, g=1, b=1},
			}	
		)
	end	
	
	--rewrite and add a rock expert ÑìîîìÌùî? make a new show? Translation from RikkiLook
	if isMissionCompleted("factory_explosive") and not isMissionCompleted("caveisland_roboclear") then
		addShow(news,
			{
				title = 'Îéóòîòïéäìðã¿ ñãùîã',
				ticker = "Éû ýãõöò óôìñìðã¾ö ëã \"çôãñìö\", ñò îãî õòëèã¾öõ¿ õîãïº? Â õòëèãñìì õîãï ùýãõöåù¾ö îãî åòèã, öãî ì åéöéô. àôòëìòññºé ùöéõº, òäôãëù¾ÿìéõ¿ õôéèì äéôéçòåòí ïìñìì, ñãóôìðéô, îôùöºé ùöéõº å Ëùïïìñçöòñé, ìðé¾ö öéñèéñüì¾ ôãëôùþãö¼õ¿ äºõöôéé, ýéð èôùçìé õîïòñº, óòõîòï¼îù ñãìäòïéé ìñöéñõìåñã¿ ½ôòëì¿ óôòìõûòèìö ù òõñòåãñì¿ ùöéõã.",
				events = 
				{
					"studio",
					"studio tv/cliff1.jpg",
					"still tv/cliff1.jpg",
					"zoom tv/cliff2.jpg",
					"still tv/cliff3.jpg",
					"zoom tv/cliff3.jpg",
					"zoom tv/cliff4.jpg",
					"zoom tv/cliff5.jpg",
				}
			}
		)	
	end	

	if isMissionCompleted("caveisland_roboclear") and not isMissionCompleted("cullington_bomb") then
		addShow(newsIntro)
		addShow(news,
			{
				title = 'Èãðéýéñã õöôãññã¿ ðãþìñã',
				ticker = "Ó¿êéïºí ãåöòðòäìï¼, óôìäïìêã¾ÿìíõ¿ î Ëãïïìñçöòñù, åºëåãï ñãõöò¿ÿìí óéôéóòïòû å ôãíòñé, ì ðñòçìé ï¾èì ½åãîùìôù¾öõ¿ ìë õåòìû èòðòå. \"â îãî ôãë ñãóôãåï¿ïõ¿ î õåòéðù äôãöù, îòçèã ùåìèéï ½öòö õöôãññòçò åìèã çôùëòåìî. Áùèùýì èòåòï¼ñò îôùóñºð óãôñéð, ¿ óòóºöãïõ¿ òõöãñòåìö¼ éçò, ñò, óòûòêé, öãð ñéö åòèìöéï¿!\", - çòåòôìö Ëéññéö Ñìóóé, õöôéð¿ÿìíõ¿ ùéûãö¼ ìë çòôòèã åðéõöé õò õåòìð äôãöòð.",
				public = "kenneth-rippe",
				events = 
				{
					"studio tv/truxterminator1.jpg",
					"still tv/truxterminator1.jpg",
					"still tv/truxterminator2.jpg",
					"studio tv/truxterminator2.jpg",
					"interview tv/truxterminator3.jpg",
					"interview tv/truxterminator3.jpg",
					"interview tv/truxterminator3.jpg",
					"still tv/truxterminator2.jpg",
					"studio tv/truxterminator2.jpg",
				}
			}
		)	
		addShow(newsOutro)
	end	

	--add amanatides
	if isMissionCompleted("cullington_bomb") then
		--addShow(newsIntro)
		addShow(news,
			{
				title = 'Áòõõ îòðóãñìì BlueTide ëã ôéþéöîòí',
				ticker = "Ðòõïé åóéýãöï¿¾ÿéçò ãôéõöã ñã òõöôòåé Öòïïòùôòî, õå¿ëãññòçò õ ûôãñìïìÿéð õéîôéöñºð öùññéïéð ì ïãäòôãöòôìéí óò óôòìëåòèõöåù ñãôîòöìîòå ñã ýãõöñòð òõöôòåé Íùôãöòôìõ, ç-ñ Àðãñãöìèéõ, åïãèéïéü îòðóãñìì BlueTide Inc, äºï òõùêèéñ ëã óòèðéþìåãñìé åéÿéõöå, åºëºåã¾ÿìû óôìåºîãñìé, å óòóùï¿ôñºí ½ñéôçéöìýéõîìí ñãóìöòî. Óéóéô¼ BlueTide òöòëåãñ õ ôºñîã.",
				events = 
				{
					"studio tv/raid4.jpg",
					"still tv/raid5.jpg",
					"zoom tv/raid8.jpg",
					"still tv/raid7.jpg",
					"zoom tv/raid6.jpg",
					"studio tv/raid1.jpg",
					"still tv/raid1.jpg",
					"still tv/raid2.jpg",
					"studio tv/raid2.jpg",
					"studio tv/raid3.jpg",
					"zoom tv/raid3.jpg",
					"studio tv/raid3.jpg",
				}
			}
		)	
		addShow(newsOutro)
	end	
	
	gCurrentShow = 1
	
	shakeX = 0
	shakeY = 0
	shakeDx = 0
	shakeDy = 0

	talk = false
	talkTimer = 10
	
end


function update()
	gFrame = gFrame + 1
	shakeDx = (shakeDx + math.random(-100,100)*0.0003) * 0.9
	shakeDy = (shakeDy + math.random(-100,100)*0.0003) * 0.9
	shakeX = (shakeX + shakeDx) * 0.99
	shakeY = (shakeY + shakeDy) * 0.99
	if shakeX > 1.0 then shakeX = 1.0 shakeDx = 0.0 end
	if shakeX < -1.0 then shakeX = -1.0 shakeDx = 0.0 end
	if shakeY > 1.0 then shakeY = 1.0 shakeDy = 0.0 end
	if shakeY < -1.0 then shakeY = -1.0 shakeDy = 0.0 end

	talkTimer = talkTimer - 1
	if talkTimer <= 0 then
		talk = not talk
		talkTimer = math.random(2, 10)
	end
	
	blink = (gFrame%130) < 5
end


function draw()
	if UiHeight() ~= 480 then
		UiPush()
			UiColor(0.2, 0.2, 0.2)
			UiRect(UiWidth(), UiHeight())
		UiPop()
		UiTranslate(UiCenter(), UiMiddle())
		UiAlign("center middle")
		UiWindow(640, 480, true)
		UiAlign("left")
		UiPush()
			UiColor(0,0,0)
			UiRect(UiWidth(), UiHeight())
		UiPop()
	end
	local dt = GetTimeStep()
	UiPush()
		local done = not gShows[gCurrentShow].func(dt, gShows[gCurrentShow].params)
	UiPop()

	if done then
		gFadeToBlack = gFadeToBlack + dt*3.0
		if gFadeToBlack >= 1.0 then
			gCurrentShow = gCurrentShow + 1
			if gCurrentShow > #gShows then
				gCurrentShow = 1
			end
			gTime = 0.0
			gTimeLast = 0.0
		end
	else
		if gFadeToBlack > 0.0 then
			gFadeToBlack = gFadeToBlack - dt*3.0
			if gFadeToBlack < 0.0 then gFadeToBlack = 0 end
		end
		gTimeLast = gTime
		gTime = gTime + dt
	end

	if gFadeToBlack > 0.0 then
		UiColor(0, 0, 0, gFadeToBlack)
		UiRect(640, 480)
	end
end


