change modal windows javascript to OOP