Afghanistan attacks leave 18 dead ahead of polls