If String Not Empty Javascript Function Definition