adding useful javascript editing functions