Step 1 : Lets first create the Apex class
Things to Remember:
Class needs to be a Global class
and the method you intend to call from the javascript must be a WebService Method
e.g.
Global Class RG_LeadConversionCls {
webservice static...
Add or remove standard buttons
1A. For standard objects
i. From Setup, click Customize| then click the object you want to modify | click Search Layouts.
1B. For custom objects
i. From Setup, click Create | then...