function friendly(textValue){
		var url = textValue
  	.toLowerCase() // change everything to lowercase
  	.replace(/^\s+|\s+$/g, "") // trim leading and trailing spaces		
  	.replace(/[_|\s]+/g, "-") // change all spaces and underscores to a hyphen
  	.replace(/[^a-z0-9-]+/g, "") // remove all non-alphanumeric characters except the hyphen
  	.replace(/[-]+/g, "_") // replace multiple instances of the hyphen with a single instance
  	.replace(/^-+|-+$/g, "") // trim leading and trailing hyphens				
  	; 
		
		return url;
}

function clearForm(formID) {
	form = $('#'+formID);
	// iterate over all of the inputs for the form
  // element that was passed in
  $(':input', form).each(function() {
	  var type = this.type;
	  var tag = this.tagName.toLowerCase(); // normalize case
	  // it's ok to reset the value attr of text inputs,
	  // password inputs, and textareas
	  if (type == 'text' || type == 'password' || tag == 'textarea')
	  	this.value = "";
	  	// checkboxes and radios need to have their checked state cleared
	  	// but should *not* have their 'value' changed
	  else if (type == 'checkbox' || type == 'radio')
	  	this.checked = false;
	  	// select elements need to have their 'selectedIndex' property set to -1
	  	// (this works for both single and multiple select elements)
	  else if (tag == 'select')
	  	this.selectedIndex = -1;
  });
};

function checkNumber(textBox){
	while (textBox.value.length > 0 && isNaN(textBox.value)) {
		textBox.value = textBox.value.substring(0, textBox.value.length - 1)
	}
	
	textBox.value = trim(textBox.value);
}
