You don't need to use controllers for this:
<style>
.spinnerBg{
width: 100%;
height: 100%;
position: absolute;
background-color: #000;
opacity: 0.2;
z-index: 999999;
}
.spinner{
width: 100%;
height: 100%;
position: absolute;
background-image: url("/img/loading32.gif");
background-size: 16px;
background-repeat: no-repeat;
background-attachment: fixed;
background-position: center;
z-index: 9999999;
opacity: 1;
}
</style>
<apex:actionStatus id="spinnerStatus">
<apex:facet name="start">
<div class="spinnerBg" />
<div id="spinner"class="spinner" />
</apex:facet>
</apex:actionStatus>
then you just reference the status id on your action as usual:
<apex:commandButton status="spinnerStatus"..