Separate compare dialog code from xul