--[[
	MonkeyFrames.lua:
	Common functions for MonkeyFrames

	Website:	http://www.toctastic.net/
	Author:		Trentin (trentin@toctastic.net)
--]]


--[[
	This is the common close button function for a MonkeyFrame
--]]
function MonkeyCloseBtn_OnClick()

	this:GetParent():Hide();
end

--[[
	this function is called when the frame should be dragged around
--]]
function MonkeyFrames_OnMouseDown(arg1)

	-- left button moves the frame around
	if (arg1 == "LeftButton") then
		this:GetParent():StartMoving();
	end
end

--[[
	this function is called when the frame is stopped being dragged around
--]]
function MonkeyFrames_OnMouseUp(arg1)

	if (arg1 == "LeftButton") then
		this:GetParent():StopMovingOrSizing();
	end
end

--[[
	this function is called when the frame should be dragged around
--]]
function MonkeyResizerBtn_OnMouseDown(arg1)

	-- left button moves the frame around
	if (arg1 == "LeftButton") then
		
		this:GetParent():StartSizing();
		
	end
end

--[[
	this function is called when the frame is stopped being dragged around
--]]
function MonkeyResizerBtn_OnMouseUp(arg1)

	if (arg1 == "LeftButton") then

		this:GetParent():StopMovingOrSizing();

	end
end