There is an even easier way that does not involve writing anything in the code behind: Just add this line to your javascript:
if(<%=(Not Page.IsPostBack).ToString().ToLower()%>){//Your JavaScript goodies here}
or
if(<%=(Page.IsPostBack).ToString().ToLower()%>){//Your JavaScript goodies here}