Javascirpt sample code