Approximation Algorithms And Inapproximability Of Partition Functions Of Spin Systems