We consider a wireless relay network with Rayleigh fading channels, and apply distributed space-time coding (DSTC) in amplify-and-forward (AF) mode. It is assumed that the relays have statistical channel state information (CSI) of the local source-relay channels, while the destination has full instantaneous CSI of channels. It turns out that, combined with power allocation in the relays, AF DSTC results in a new opportunistic relaying scheme, in which the best relay is selected to retransmit the source's signal. Furthermore, we have derived the optimum power allocation between two cooperative transmission phases by maximizing the average received SNR at the destination. Next, assuming M-PSK and M-QAM modulations, we analyze the performance of cooperative diversity wireless networks using AF opportunistic relaying. We first derive the probability density function (pdf) and the moment generating function (MGF) of the received SNR at the destination. Then, the MGF is used to determine the symbol error rate in Rayleigh fading channels. Our analytical results have been confirmed by simulation results, using full-rate, full-diversity distributed space-time codes.