my common use javascript function