<SCRIPT LANGUAGE="JavaScript">
<!--
function saveStateZip(){
  for(i=0;i < document.forms[0].length;i++){
       var fieldToTest = document.forms[1].elements[i].name;
       if(fieldToTest == "04-B-STATE"){
          var State = document.forms[1].elements[i].value;
          document.cookie = "x_State=" + State + "; path=/";
          document.cookie = "x_Ship_To_State=" + State + "; path=/";
       }
       if(fieldToTest == "19_destPostal"){
          var Zip = document.forms[1].elements[i].value;
          document.cookie = "x_Zip=" + Zip + "; path=/";
          document.cookie = "x_Ship_To_Zip=" + Zip + "; path=/";
       }
  }
}
//-->
</SCRIPT>

Then add this to the body tag:

<BODY onUnload="saveStateZip();">