
function nameToUrl(name)
{var url=name.toLowerCase();url=url.replace(/_/g,"");url=url.replace(/å/g,"a");url=url.replace(/ä/g,"a");url=url.replace(/ö/g,"o");url=url.replace(/\W/g,"_");return url;}
function dateTimeUpdate(id,disable)
{if(typeof disable=='undefined'||!disable)
$('#'+id+'Enabled').attr('checked','checked');var years=$('#'+id+'Years').get(0);var months=$('#'+id+'Months').get(0);var days=$('#'+id+'Days').get(0);var hours=$('#'+id+'Hours').get(0);var minutes=$('#'+id+'Minutes').get(0);var timestamp=$('#'+id+'Timestamp').get(0);var month=new Date(years.options[years.selectedIndex].value,months.options[months.selectedIndex].value,0);var daysInMonth=month.getDate();var daysInOld=days.length;if(daysInMonth>daysInOld)
{for(i=1;i<=(daysInMonth-daysInOld);i++)
{var option=document.createElement('option');option.value=daysInOld+i;option.text=daysInOld+i;try
{days.add(option,null);}
catch(ie)
{days.add(option);}}}
if(daysInMonth<daysInOld)
{for(i=1;i<=(daysInOld-daysInMonth);i++)
days.remove(daysInOld-i);}
if(hours&&minutes)
var date=new Date(years.options[years.selectedIndex].value,months.options[months.selectedIndex].value-1,days.options[days.selectedIndex].value,hours.options[hours.selectedIndex].value,minutes.options[minutes.selectedIndex].value,0);else
var date=new Date(years.options[years.selectedIndex].value,months.options[months.selectedIndex].value-1,days.options[days.selectedIndex].value,0,0,0);timestamp.value=date.getTime()/1000.0;}