Development of Seismic Control Algorithm of RC Moment Frame Structures Resting on Nonlinear Flexible Foundation Equipped with Magneto Rheological (MR) Dampers by Considering the Nonlinear Behavior of Structure and Damper and Optimal Placement of Dampers