Just wrap your code in an if statement.
<?php
if($login_failed == true)
{
?>
<div class="shell-error">
<!--
<div type="hidden" class="msg msg-error">
<p><?php echo $error_message; ??></p>
<a href="#" class="close">close</a>
</div>
<!--
</div>
<?php
}
?>