(a) Except as otherwise provided in this section, when a transaction bears a reasonable relation to this state and also to another state or nation, the parties may agree that the law of this state or of the other state or nation shall govern the parties' rights and duties.
(b) In the absence of an agreement effective under (a) of this section, and except as provided in (c) of this section, the code applies to transactions bearing an appropriate relation to this state.
(c) If one of the following provisions of the code specifies the applicable law, that provision governs, and a contrary agreement is effective only to the extent permitted by the applicable law specified by that provision:
(1) AS 45.02.402;
(2) AS 45.04.102;
(3) AS 45.05.116;
(4) AS 45.08.110;
(5) AS 45.12.105 and 45.12.106;
(6) AS 45.14.507;
(7) AS 45.29.301 - 45.29.307.