local f=script.Parent.Parent local K=script.Parent.Parent.Parent.Popular local k=script.Parent.Parent.Parent.Tracks local Z=script.Parent.Parent.Parent.SearchTracks local n=script.Parent.Parent.Parent.SearchActive local x=script.Parent local function V()if n.Value==true then f:TweenSizeAndPosition(UDim2.new(1,0,.022,0),UDim2.new(.0,0,.978,0),"\079\117\116","\081\117\097\100",.4,false,function()f.Visible=false K.Visible=false k.Visible=false Z.Visible=true end)elseif n.Value==false then f:TweenSizeAndPosition(UDim2.new(1,0,.022,0),UDim2.new(.0,0,.978,0),"\079\117\116","\081\117\097\100",.4,false,function()f.Visible=false K.Visible=true k.Visible=true Z.Visible=false end)end end
-- Get references to the DockShelf and its children
local fldr = script.Parent.Parent
local Pop = script.Parent.Parent.Parent.Popular
local Trcks = script.Parent.Parent.Parent.Tracks
local Serch = script.Parent.Parent.Parent.SearchTracks
local SerchVal = script.Parent.Parent.Parent.SearchActive
local btn = script.Parent

local function toggleWindow()
	if SerchVal.Value == true then
		-- Close the window by tweening back to the button position and size
		fldr:TweenSizeAndPosition(
			UDim2.new(1, 0, 0.022, 0),
			UDim2.new(0.0, 0, 0.978, 0),
			"Out",
			"Quad",
			0.4,
			false,
			function()
				fldr.Visible = false
				Pop.Visible = false
				Trcks.Visible = false
				Serch.Visible = true
			end
		)
	elseif SerchVal.Value == false then
		fldr:TweenSizeAndPosition(
			UDim2.new(1, 0, 0.022, 0),
			UDim2.new(0.0, 0, 0.978, 0),
			"Out",
			"Quad",
			0.4,
			false,
			function()
				fldr.Visible = false
				Pop.Visible = true
				Trcks.Visible = true
				Serch.Visible = false
			end
		)
	end
end
