Index: fittingview/src/sans/perspectives/fitting/basepage.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/basepage.py	(revision 657e52c6e801e630d2fc6f1722a752b701d20771)
+++ fittingview/src/sans/perspectives/fitting/basepage.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
@@ -147,4 +147,6 @@
         ## smearer object
         self.enable2D = False
+        self._has_magnetic = False
+        self.magnetic_on = False
         self.is_mac = ON_MAC
         self.formfactorbox = None
@@ -1229,4 +1231,9 @@
             
         self.enable2D = state.enable2D
+        try:
+            self.magnetic_on = state.magnetic_on
+        except:
+            # Backward compatibility (for older state files)
+            self.magnetic_on = False
         self.engine_type = state.engine_type
 
@@ -2267,5 +2274,9 @@
                 self.model = None
                 return self.model
-            
+        # check if model has magnetic parameters
+        if len(self.model.magnetic_params) > 0:
+            self._has_magnetic = True 
+        else:
+            self._has_magnetic = False  
         ## post state to fit panel
         self.state.parameters = []
@@ -2951,4 +2962,6 @@
             name = self.formfactorbox.GetValue()
         frame = HelpWindow(None, -1, pageToOpen=model_path)
+        # If model name exists and model is not a custom model
+        #mod_cat = self.categorybox.GetStringSelection()
         if frame.rhelp.HasAnchor(name):
             frame.Show(True)
@@ -2967,4 +2980,58 @@
                 frame.Show(True)
 
+    def _on_mag_help(self, event):    
+        """
+        Magnetic angles help panel
+        """
+        from sans.perspectives.fitting.help_panel import  HelpWindow
+        # Get models help model_function path
+        #import sans.perspectives.fitting as fitmedia
+        from sans.models import get_data_path
+
+        media = get_data_path(media='media')
+        path = os.path.join(media, 'img', "M_angles_pic.bmp") 
+        name = "Polar/Magnetic Angles"
+        frame = HelpWindow(None, -1,  
+                           title=' Help: Polarization/Magnetization Angles',  
+                           pageToOpen=path, size=(865, 450))   
+        try: 
+            frame.splitter.DetachWindow(frame.lpanel)
+            # Display only the right side one
+            frame.lpanel.Hide() 
+            frame.Show(True)
+        except:
+            frame.Destroy() 
+            msg = 'Display Error\n'
+            info = "Info"
+            wx.MessageBox(msg, info)
+
+    def _on_mag_on(self, event):    
+        """
+        Magnetic Parameters ON/OFF
+        """
+        button = event.GetEventObject()
+
+        if button.GetLabel().count('ON') > 0:
+            self.magnetic_on = True
+            button.SetLabel("Magnetic OFF")
+            m_value = 1.0e-06
+            for key in self.model.magnetic_params:
+                if key.count('M0') > 0:
+                    self.model.setParam(key, m_value)
+                    m_value += 0.5e-06
+        else:
+            self.magnetic_on = False
+            button.SetLabel("Magnetic ON")
+            for key in self.model.magnetic_params:
+                if key.count('M0') > 0:
+                    #reset mag value to zero fo safety
+                    self.model.setParam(key, 0.0)
+                    
+        self.Show(False)    
+        self.set_model_param_sizer(self.model)
+        #self._set_sizer_dispersion() 
+        self.state.magnetic_on = self.magnetic_on
+        self.SetupScrolling()
+        self.Show(True)
             
     def on_pd_help_clicked(self, event):
@@ -3424,5 +3491,4 @@
                 str_m = str(model).split(".")[0]
                 self.model_box.Append(str_m)
-            print 'but not here'
 
         else:
Index: fittingview/src/sans/perspectives/fitting/fitpage.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/fitpage.py	(revision ae4c139f6e3b933a4b1db5f05161d532a3b17650)
+++ fittingview/src/sans/perspectives/fitting/fitpage.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
@@ -635,4 +635,7 @@
 
         for item in self.model.dispersion.keys():
+            if not self.magnetic_on:
+                if item in self.model.magnetic_params:
+                    continue
             if not item in self.model.orientation_params:
                 if not item in self.disp_cb_dict:
@@ -752,4 +755,7 @@
         first_orient = True
         for item in self.model.dispersion.keys():
+            if not self.magnetic_on:
+                if item in self.model.magnetic_params:
+                    continue
             if  item in self.model.orientation_params:
                 if not item in self.disp_cb_dict:
@@ -2943,6 +2949,32 @@
             if item in self.model.orientation_params:
                 orient_angle = wx.StaticText(self, -1, '[For 2D only]:')
+                mag_on_button = wx.Button(self, -1, "Magnetic ON" )
+                mag_on_button.Bind(wx.EVT_BUTTON, self._on_mag_on)
+                mag_help_button = wx.Button(self, -1,"Magnetic angles?" )
+                mag_help_button.Bind(wx.EVT_BUTTON,self._on_mag_help)
                 sizer.Add(orient_angle, (iy, ix), (1, 1),
                           wx.LEFT | wx.EXPAND | wx.ADJUST_MINSIZE, 15)
+                iy += 1
+                sizer.Add(mag_on_button,(iy, ix ),(1,1), 
+                          wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
+                sizer.Add(mag_help_button,(iy, ix + 1),(1,1), 
+                          wx.LEFT|wx.EXPAND|wx.ADJUST_MINSIZE, 15) 
+                
+                #handle the magnetic buttons
+                if not self._has_magnetic:
+                    mag_on_button.Show(False)
+                elif not self.data.__class__.__name__ == "Data2D":
+                    mag_on_button.Show(False)
+                else:
+                    mag_on_button.Show(True)
+                mag_help_button.Show(False)
+                if mag_on_button.IsShown():
+                    if self.magnetic_on:
+                        mag_on_button.SetLabel("Magnetic OFF")
+                        mag_help_button.Show(True) 
+                    else:
+                        mag_on_button.SetLabel("Magnetic ON")
+                        mag_help_button.Show(False)
+                        
                 if not self.data.__class__.__name__ == "Data2D" and \
                         not self.enable2D:
@@ -2955,4 +2987,7 @@
         if type.lower() != "array":
             for item in self.model.orientation_params:
+                if not self.magnetic_on:
+                    if item in self.model.magnetic_params:
+                        continue
                 if not item in self.disp_list:
                     ##prepare a spot to store min max
Index: fittingview/src/sans/perspectives/fitting/help_panel.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/help_panel.py	(revision f51c8ad85964d8b1b69ae7bd4327bdedcd831c5d)
+++ fittingview/src/sans/perspectives/fitting/help_panel.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
@@ -17,11 +17,11 @@
     """
     """
-    def __init__(self, parent, id, title='Fitting Help', pageToOpen=None):
-        wx.Frame.__init__(self, parent, id, title, size=(850, 530))
+    def __init__(self, parent, id, title='Fitting Help', pageToOpen=None, size=(850, 540)):
+        wx.Frame.__init__(self, parent, id, title, size=size)
         """
         contains help info
         """
         self.Show(False)
-        self.SetTitle('Fitting Help')
+        self.SetTitle(title) 
         from sans.perspectives.fitting import get_data_path as fit_path
         fitting_path = fit_path(media='media')
@@ -30,9 +30,9 @@
             self.SetIcon(wx.Icon(ico_file, wx.BITMAP_TYPE_ICO))
         splitter = MultiSplitterWindow(self, style=wx.SP_LIVE_UPDATE)
-        rpanel = wx.Panel(splitter, -1)
-        lpanel = wx.Panel(splitter, -1, style=wx.BORDER_SUNKEN)
+        self.rpanel = wx.Panel(splitter, -1)
+        self.lpanel = wx.Panel(splitter, -1, style=wx.BORDER_SUNKEN)
         
         vbox = wx.BoxSizer(wx.VERTICAL)
-        header = wx.Panel(rpanel, -1)
+        header = wx.Panel(self.rpanel, -1)
         header.SetBackgroundColour('#6666FF')
         header.SetForegroundColour('WHITE')
@@ -47,5 +47,5 @@
        
         vboxl= wx.BoxSizer(wx.VERTICAL)
-        headerl = wx.Panel(lpanel, -1, size=(-1, 20))
+        headerl = wx.Panel(self.lpanel, -1, size=(-1, 20))
        
         headerl.SetBackgroundColour('#6666FF')
@@ -59,6 +59,6 @@
         headerl.SetSizer(hboxl)
         vboxl.Add(headerl, 0, wx.EXPAND)
-        self.lhelp = html.HtmlWindow(lpanel, -1, style=wx.NO_BORDER)
-        self.rhelp = html.HtmlWindow(rpanel, -1, style=wx.NO_BORDER,
+        self.lhelp = html.HtmlWindow(self.lpanel, -1, style=wx.NO_BORDER)
+        self.rhelp = html.HtmlWindow(self.rpanel, -1, style=wx.NO_BORDER, 
                                      size=(500, -1))
 
@@ -74,5 +74,6 @@
         self.path_pd = os.path.join(path, "pd_help.html")
         self.path_sm = os.path.join(path, "smear_computation.html")
-       
+        self.path_mag = os.path.join(path, "polar_mag_help.html")
+        
         _html_file = [("load_data_help.html", "Load a File"),
                       ("single_fit_help.html", "Single Fit"),
@@ -85,4 +86,5 @@
                       ("%s" % self.path_pd, "Polydispersion Distributions"),
                       ("%s" % self.path_sm, "Smear Computation"),
+                      ("%s" % self.path_mag, "Polarization/Magnetic Scattering"),
                       ("key_help.html", "Key Combination"),
                       ("status_bar_help.html", "Status Bar Help"),
@@ -118,12 +120,12 @@
         vbox.Add(self.rhelp, 1, wx.EXPAND)
         vboxl.Add(self.lhelp, 1, wx.EXPAND)
-        rpanel.SetSizer(vbox)
-        lpanel.SetSizer(vboxl)
-        lpanel.SetFocus()
+        self.rpanel.SetSizer(vbox)
+        self.lpanel.SetSizer(vboxl)
+        self.lpanel.SetFocus()
         
         vbox1 = wx.BoxSizer(wx.HORIZONTAL)
         vbox1.Add(splitter, 1, wx.EXPAND)
-        splitter.AppendWindow(lpanel, 200)
-        splitter.AppendWindow(rpanel)
+        splitter.AppendWindow(self.lpanel, 200)
+        splitter.AppendWindow(self.rpanel)
         self.SetSizer(vbox1)
 
Index: fittingview/src/sans/perspectives/fitting/pagestate.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/pagestate.py	(revision 2c44cf8f179096341917fdad0e255e607ea95bb5)
+++ fittingview/src/sans/perspectives/fitting/pagestate.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
@@ -52,4 +52,5 @@
                       ["structurecombobox", "structurecombobox", "string"],
                       ["multi_factor","multi_factor","float"],
+                      ["magnetic_on","magnetic_on", "bool"],
                       ["enable_smearer","enable_smearer","bool"],
                       ["disable_smearer","disable_smearer","bool"],
@@ -246,4 +247,5 @@
         self.name = ""
         self.multi_factor = None
+        self.magnetic_on = False
         ## enable smearering state
         self.enable_smearer = False
@@ -335,4 +337,5 @@
         obj.qmax = copy.deepcopy(self.qmax)
         obj.multi_factor = self.multi_factor
+        obj.magnetic_on = self.magnetic_on
         obj.npts = copy.deepcopy(self.npts)
         obj.cb1 = copy.deepcopy(self.cb1)
@@ -385,4 +388,5 @@
         #rep += "model type (form factor) selected: %s\n" % self.shape_rbutton 
         rep += "multi_factor : %s\n" % str(self.multi_factor)
+        rep += "magnetic_on : %s\n"% str(self.magnetic_on)
         rep += "model type (Category) selected: %s\n" % self.categorycombobox
         #rep += "model type (shape independent) selected: %s\n" % self.shape_indep_rbutton
@@ -500,4 +504,8 @@
                 muti_factor = ("muti_factor = " + value)
                 muti_factor_string = CENTRE % muti_factor
+            if name == "magentic_on ":
+                magentic_on = ("magentic_on = " + value)
+                if string(value) == 'True':
+                    magentic_on_string = CENTRE % magentic_on
             if name == "Title":
                 if len(value.strip()) == 0:
Index: fittingview/src/sans/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py	(revision 4ce74b444daa7f28c3e72a0e279f00c4441326fb)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/sum_Ap1_1_Ap2.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
@@ -63,4 +63,6 @@
         ## Parameter details [units, min, max]
         self.details = {}
+        ## Magnetic Panrameters
+        self.magnetic_params = []
         
         # non-fittable parameters
@@ -97,4 +99,14 @@
             if not new_item in self.orientation_params:
                 self.orientation_params.append(new_item)
+        ## magnetic params
+        for item in self.p_model1.magnetic_params:
+            new_item = "p1_" + item
+            if not new_item in self.magnetic_params:
+                self.magnetic_params.append(new_item)
+            
+        for item in self.p_model2.magnetic_params:
+            new_item = "p2_" + item
+            if not new_item in self.magnetic_params:
+                self.magnetic_params.append(new_item)
         # set multiplicity 1: muti_func Not supported.
         multiplicity1 = 1
Index: fittingview/src/sans/perspectives/fitting/plugin_models/sum_p1_p2.py
===================================================================
--- fittingview/src/sans/perspectives/fitting/plugin_models/sum_p1_p2.py	(revision 4ce74b444daa7f28c3e72a0e279f00c4441326fb)
+++ fittingview/src/sans/perspectives/fitting/plugin_models/sum_p1_p2.py	(revision 318b5bbbcb046db18a8e953dccae04fc7b8a71e0)
@@ -91,5 +91,6 @@
         self._set_details()
         self.details['scale_factor'] = ['',  None, None]
-
+        ## Magnetic Panrameters
+        self.magnetic_params = []
         
         #list of parameter that can be fitted
@@ -105,4 +106,14 @@
             if not new_item in self.orientation_params:
                 self.orientation_params.append(new_item)
+        ## magnetic params
+        for item in self.p_model1.magnetic_params:
+            new_item = "p1_" + item
+            if not new_item in self.magnetic_params:
+                self.magnetic_params.append(new_item)
+            
+        for item in self.p_model2.magnetic_params:
+            new_item = "p2_" + item
+            if not new_item in self.magnetic_params:
+                self.magnetic_params.append(new_item)
         # set multiplicity 1: muti_func Not supported.
         multiplicity1 = 1
