Javascript sample codes