  We describe a wide and deep search for optical GRB afterglows on images taken
with MegaCAM at the Canada France Hawaii Telescope, within the framework of the
CFHT Legacy Survey. This search is performed in near real-time thanks to a Real
Time Analysis System called "Optically Selected GRB Afterglows", which has been
completely realized and installed on a dedicated computer in Hawaii. This
pipeline automatically and quickly analyzes Megacam images and extracts from
them a list of astrometrically and photometrically variable objects which are
displayed on a web page for validation by a member of the collaboration. In
this paper, we comprehensively describe the RTAS process. We also present
statistical results based on nearly one full year of operation, showing the
quality of the images and the performance of the RTAS. Finally, we compare the
efficiency of this study with similar searches, propose an ideal observational
strategy using simulations, and discuss general considerations on the searches
for GRB afterglows independently of the prompt emission. This is the first of a
series of two papers. A second paper will discuss the characterization of
variable objects we have found, as well as the GRB afterglow candidates and
their nature. We will also estimate or at least constrain the collimation
factor of GRB using the totality of the Very Wide Survey observations.
