.namespace PopupsYN_btn


function OnWbpMouseLUp()
	if not PopupManager.active then
		return false
	end	
	PlaySoundEffect("int_click")
	if self.Name == "yn_yes" or self.Name == "info_ok" then
		OPLog.Log("hello yn info")
		PopupManager.active = false
		PopupManager.g_popupansw = true		
		SpriteFader.Fade(popups_background,false,0.4,PopupManager)
		SpriteFader.Fade(yn_yes,false,0.4)
		SpriteFader.Fade(yn_no,false,0.4)
		SpriteFader.Fade(info_ok,false,0.4)
		SpriteFader.Fade(popups_fade,false,0.4)		
		return true		
	end
	if self.Name == "yn_no" then
		PopupManager.active = false
		PopupManager.g_popupansw = false		
		SpriteFader.Fade(popups_background,false,0.4,PopupManager)
		SpriteFader.Fade(yn_yes,false,0.4)
		SpriteFader.Fade(yn_no,false,0.4)
		SpriteFader.Fade(popups_fade,false,0.4)		
		return true
	end	
	return false
end

function OnMouseOn()
	if self.Name=="yn_yes" then
		yn_yes.SetFrame(1)
	elseif self.Name=="yn_no" then
		yn_no.SetFrame(1)
	else 
		info_ok.SetFrame(1)
	end
end

function OnMouseOff()
	yn_no.SetFrame(0)
	yn_yes.SetFrame(0)
	info_ok.SetFrame(0)
end