yes you can, check the link out below:
http://blogs.msdn.com/b/infopath/archive/2010/03/18/introduction-to-programming-in-infopath-2010.aspx
its too big to go through to post here! bottom line is you need to add codebehind and add
private string BindScript(string ScriptUrl, bool PickFromSiteCollection)
{
if (PickFromSiteCollection)
ScriptUrl = Microsoft.SharePoint.Utilities.SPUrlUtility.CombineUrl(SPContext.Current.Site.RootWeb.Url, ScriptUrl);
else
ScriptUrl = Microsoft.SharePoint.Utilities.SPUrlUtility.CombineUrl(SPContext.Current.Web.Url, ScriptUrl);
return string.Format(@"<script type=""text/javascript"" src=""{0}""></script>", ScriptUrl);
}
call the above method in an event that you require (override) like onload or onsubmit ect
writer.Write(BindScript("/_layouts/1033/js/jquery.min.js", true));