Query post & loop problem.

no idea what the problems actually are, but from looking at the code, I woud suggest:

a:
the while (have_posts()) : should be while ($the_query->have_posts()) :

b:
you would need to increment the counter:
<?php $count = $count + 1; ?>

c:
the endif; of the loop might be missing after the endwhile; – at least it is not shown in the posted code section.