use Downlevel-revealed conditional comments :
<!--[if lte IE 6]><![if gte IE 7]><![endif]-->
<!-- keep your script in between these two comments,
it will work in all browser except ie -->
<!--[if lte IE 6]><![endif]><![endif]-->
Explained here : Hiding some HTML from IE6?