

function Build1Tab2::buttonSelect()
{
   Build1Tab1.selected = false;
   Build2Tab1.selected = false;
   Build3Tab1.selected = false;
   Build1Tab2.selected = true;
   Build2Tab2.selected = true;
   Build3Tab2.selected = true;
   Build1Tab3.selected = false;
   Build2Tab3.selected = false;
   Build3Tab3.selected = false;
   
   BuildHud1.visible = false;
   BuildHud2.visible = true;
}

function Build1Tab3::buttonSelect()
{
   Build1Tab1.selected = false;
   Build2Tab1.selected = false;
   Build3Tab1.selected = false;
   Build1Tab2.selected = false;
   Build2Tab2.selected = false;
   Build3Tab2.selected = false;
   Build1Tab3.selected = true;
   Build2Tab3.selected = true;
   Build3Tab3.selected = true;
   
   BuildHud1.visible = false;
   BuildHud3.visible = true;
}

function Build2Tab1::buttonSelect()
{
   Build1Tab1.selected = true;
   Build2Tab1.selected = true;
   Build3Tab1.selected = true;
   Build1Tab2.selected = false;
   Build2Tab2.selected = false;
   Build3Tab2.selected = false;
   Build1Tab3.selected = false;
   Build2Tab3.selected = false;
   Build3Tab3.selected = false;
   
   BuildHud2.visible = false;
   BuildHud1.visible = true;
}

function Build2Tab3::buttonSelect()
{
   Build1Tab1.selected = false;
   Build2Tab1.selected = false;
   Build3Tab1.selected = false;
   Build1Tab2.selected = false;
   Build2Tab2.selected = false;
   Build3Tab2.selected = false;
   Build1Tab3.selected = true;
   Build2Tab3.selected = true;
   Build3Tab3.selected = true;
   
   BuildHud2.visible = false;
   BuildHud3.visible = true;
}

function Build3Tab1::buttonSelect()
{
   Build1Tab1.selected = true;
   Build2Tab1.selected = true;
   Build3Tab1.selected = true;
   Build1Tab2.selected = false;
   Build2Tab2.selected = false;
   Build3Tab2.selected = false;
   Build1Tab3.selected = false;
   Build2Tab3.selected = false;
   Build3Tab3.selected = false;
   
   BuildHud3.visible = false;
   BuildHud1.visible = true;
}

function Build3Tab2::buttonSelect()
{
   Build1Tab1.selected = false;
   Build2Tab1.selected = false;
   Build3Tab1.selected = false;
   Build1Tab2.selected = true;
   Build2Tab2.selected = true;
   Build3Tab2.selected = true;
   Build1Tab3.selected = false;
   Build2Tab3.selected = false;
   Build3Tab3.selected = false;
   
   BuildHud3.visible = false;
   BuildHud2.visible = true;
}

//  ------------ BUILDING BUTTONS --------------

function SaloonButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Saloon, Orc);
}

function HotelButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Hotel, Orc);
}

function WellButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Well, Orc);
}

function GeneralButton::buttonSelect()
{
   csExecuteBuildCmdBtn(General, Orc);
}

function GranaryButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Granary, Orc);
}

function ShackButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Shack, Orc);
}

function WoodhutButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Woodhut, Orc);
}

function FarmButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Farm, Orc);
}

function BankButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Bank, Orc);
}

function WatertowerButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Watertower, Orc);
}

function WindmillButton::buttonSelect()
{
   csExecuteBuildCmdBtn(windmill, Orc);
}

function OuthouseButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Outhouse, Orc);
}

function RanchButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Ranch, Orc);
}

function GazeboButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Gazebo, Orc);
}

function SheriffsOfficeButton::buttonSelect()
{
   csExecuteBuildCmdBtn(SheriffsOffice, Orc);
}

function TrainstationButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Trainstation, Orc);
}

function TradingpostButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Tradingpost, Orc);
}

function LumbermillButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Lumbermill, Orc);
}

function ChurchButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Church, Orc);
}

function BarbershopButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Barbershop, Orc);
}

function LogcabinButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Logcabin, Orc);
}

function WatchtowerButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Watchtower, Orc);
}

function GoldMineButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Goldmine, Orc);
}

function BlacksmithButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Blacksmith, Orc);
}

function BridgeButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Bridge, Orc);
}

function TownhallButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Townhall, Orc);
}

function StatueButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Statue, Orc);
}

function TownbellButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Townbell, Orc);
}

function FlowerpotButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Flowerpot, Orc);
}

function HoneypotButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Honeypot, Orc);
}

function FountainButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Fountain, Orc);
}

function WelcomesignButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Welcomesign, Orc);
}

function SmokehouseButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Smokehouse, Orc);
}

function CemeteryButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Cemetery, Orc);
}

function RoadwayButton::buttonSelect()
{
   csExecuteBuildCmdBtn(Roadway, Orc);
}

function applyBuildingDataToBuildingButton()
{
   SaloonButton.buildingData         = Saloon;
   HotelButton.buildingData          = Hotel;
   WellButton.buildingData           = well;
   GeneralButton.buildingData        = General;
   GranaryButton.buildingData        = Granary;
   ShackButton.buildingData          = Shack;
   WoodhutButton.buildingData        = Woodhut;
   FarmButton.buildingData           = Farm;
   BankButton.buildingData           = Bank;
   WatertowerButton.buildingData     = watertower;
   WindmillButton.buildingData       = Windmill;
   OuthouseButton.buildingData       = Outhouse;
   RanchButton.buildingData          = Ranch;
   GazeboButton.buildingData         = Gazebo;
   SheriffsOfficeButton.buildingData = SheriffsOffice;
   TrainstationButton.buildingData   = trainstation;
   TradingpostButton.buildingData    = Tradingpost;
   LumbermillButton.buildingData     = Lumbermill;
   ChurchButton.buildingData         = Church;
   BarbershopButton.buildingData     = Barbershop;
   LogcabinButton.buildingData       = Logcabin;
   WatchtowerButton.buildingData     = Watchtower;
   GoldMineButton.buildingData       = Goldmine;
   BlacksmithButton.buildingData     = Blacksmith;
   BridgeButton.buildingData         = Bridge;
   TownhallButton.buildingData       = TownHall;
   StatueButton.buildingData         = Statue;
   TownbellButton.buildingData       = Townbell;
   FlowerpotButton.buildingData      = Flowerpot;
   FenceButton.buildingData          = fence;
   FountainButton.buildingData       = Fountain;
   WelcomesignButton.buildingData    = welcomesign;
   SmokehouseButton.buildingData     = Smokehouse;
   HoneypotButton.buildingData       = Honeypot;
   CemeteryButton.buildingData       = Cemetery;
   //RoadwayButton.buildingData       = Roadway;
}

function HudCameraButton::buttonSelect()
{
   %obj = getSelectedObject(0);
   if (isObject(%obj))
   {
      commandToServer('MoveCameraToObject', ServerConnection.getGhostID(%obj), true);
   }
}
