
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 check_all(marker)
{if(marker.checked)
{$('#suitable_for_children_eve').attr('checked','checked');$('#suitable_for_youth_eve').attr('checked','checked');$('#suitable_for_adults_eve').attr('checked','checked');$('#suitable_for_seniors_eve').attr('checked','checked');}else{$('#suitable_for_children_eve').attr('checked','');$('#suitable_for_youth_eve').attr('checked','');$('#suitable_for_adults_eve').attr('checked','');$('#suitable_for_seniors_eve').attr('checked','');}
return true;}
function check_mark(me)
{if($('#suitable_for_children_eve').is(':checked')&&$('#suitable_for_youth_eve').is(':checked')&&$('#suitable_for_adults_eve').is(':checked')&&$('#suitable_for_seniors_eve').is(':checked'))
$('#mark_all').attr('checked','checked');else
$('#mark_all').attr('checked','');return true;}
function showWeekdays()
{if($('#f_startDays').val()==$('#f_stopDays').val()&&$('#f_startMonths').val()==$('#f_stopMonths').val()&&$('#f_startYears').val()==$('#f_stopYears').val())
{$('#weekdays').addClass('hidden');}else{$('#weekdays').removeClass('hidden');}}
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;}