/* This is a sample js file to show you how jTrace can work inside your js */
$(document).ready(function(){

	$("li.example").click(function(){
		//This next line will put a message in the jTrace Window
		jTrace('li element clicked!','');
	});

	$("p.error").click(function(){
		//This (next) line will put an error message in the jTrace Window
		jTrace('paragraph clicked, using error message!','error');
	});
	
	//Grab the value of #number-test-input, and send to numeric function
	$("#number-test-input").change(function(){
		jTrace('Value in #number-test-input = ' + this.value,'warning');
		numeric(this.value);
		jTrace('numberic function has completed','');
	});
	
});

function numeric(input){
	jTrace('Entered numeric function','');
	if(input.match(/^\d+$/)){
		jTrace('a number (' + input + ') was passed','warning');
	} else {
		jTrace('(' + input + ') is not a number!','error');
	}
	jTrace('Leaving numeric function','');
}
