function slugify(text)
{
return text.toString().toLowerCase()
.replace(/[àáâãäå]/g,"a")
.replace(/[èéêë]/g,"e")
.replace(/[ìíîï]/g,"i")
.replace(/[òóôõö]/g,"o")
.replace(/[ùúûü]/g,"u")
.replace(/[/ñ/g]/g,"n")
.replace(/\s+/g, '-') // Replace spaces with -
.replace(/[^\w\-]+/g, '') // Remove all non-word chars
.replace(/_/g, '-')
.replace(/\-\-+/g, '-') // Replace multiple - with single -
.replace(/^-+/, '') // Trim - from start of text
.replace(/-+$/, ''); // Trim - from end of text
}