--returns true if mouse is inside the rectangle

function mouseinRect(rLeft,rTop, rRight, rBottom, mouseX,mouseY)
if mouseX >= rLeft and mouseX <= rRight and mouseY >= rTop and mouseY <= rBottom then
return true -- inside the rectangle
end
return false
end