javascript dynamic insert code