When a speaker focuses on the middle of an action in the past, the imperfect is used. When an ongoing (imperfect) action is interrupted, the interrupting action should be in the preterite.
Examples:
1. Yo vía el sitio web de mi tienda favorite cuando pulsé el bóton regresar en accidente.
I was looking at the website of my favorite store when I pushed the back button on accident.
2. Yo navegaba la red cuando se perdió la conexion.
I was surfing the web when the connection got lost.
http://www.studyspanish.com
http://www.rocketlanguages.com/spanish/imperfect_spanish_past.php
http://www.123teachme.com/learn_spanish/imperfect_tense_2
http://www.bellaonline.com/articles/art32108.asp
http://www.dummies.com/how-to/content/expressing-uncertainty-in-spanish-with-the-imperfe.html
http://spanish.about.com/od/verbtenses/a/two_past_tenses.htm
http://www.onlinespanishhelp.com/
http://www.drlemon.net/Grammar/pretvsimp.html
http://www.learn-spanish-help.com/
http://www.spanishclassonline.com/