You would want to make the parent of your panels the frames that they should hide/show with. That said, I'm not familiar with that UI but assuming the UIParent in those function calls is the parent being passed:
Code:
--PetBar
CreatePanel("aPanels_PetBar01",0,0,218,31,background,border,"BOTTOMRIGHT","TOPRIGHT","aPanels_MButtons01",PetActionBarFrame)
CreatePanel("aPanels_PetBar02",0,0,218,31,background,border,"BOTTOMRIGHT","TOPRIGHT","aPanels_MButtons01",PetActionBarFrame)
--DruidStanceBar
CreatePanel("aPanels_StanceBar01",0,0,114,31,background,border,"BOTTOMLEFT","TOPLEFT","aPanels_MButtons01",ShapeshiftBarFrame)
CreatePanel("aPanels_StanceBar02",0,0,114,31,background,border,"BOTTOMLEFT","TOPLEFT","aPanels_MButtons01",ShapeshiftBarFrame)