Density functional study of molecular interactions in secondary structures of proteins