I think you are misusing a:active property. a:active property will be used when you click on the link. It has no relation to the currently opened page. When you mouse out from the link, then it means that the link is not active at that time.
Definition of :active is:
A link becomes active when you click on it.
In one of your comments, you have mentioned that "because a1 is still active page", which means that you are still on a1.aspx page. But it has nothing to do with :active. The css set in a:active will be applied when you click on the link and do not release the mouse button.
For details, check:
http://www.w3schools.com/cssref/sel_active.asp[
^]
So basically what you need is that when you are writing the C# code, set the original value of color in the onmouseout.