﻿/* A collection of reuable functions */
function FriendlyUrl(target, val, prepend) {
  var val = $.trim(val.toLowerCase()).replace(/ /g, '-').replace(/--/g, '-');
  var pattern = new RegExp('[^\- 0-9a-zA-Z]+', 'g');
  val.replace(pattern, '');

  if (prepend && prepend != 'default') {
    val = prepend + '/' + val;
  }

  $(target).val(val); 
}
function showFaq(e) {
  $(e).parent().children('div').toggle();
  return false;
}


