You don't need to do all that, we have a very simple built in control that you can out in layout.master wherever you want the plus button:
<portal:PlusOneButton id="plusone1" runat="server" showCount="false"/>
it will setup the script for you and it properly handles ssl
Hope that helps,
Joe