I am trying to display Adsense ads conditionally, is there anything wrong with the syntax of this code?

<script type="text/javascript">
if (asppg_showGoogleAds)
{
document.write("<sc"+"ript type='text/javascript' src="http://pagead2.googlesyndication.com/pagead/show_ads.js"></scr"+"ipt>");
}
</script>

Thanks