
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()
{$("a.ServicePart_dialog").live('click',function(e)
{$('body').addClass('ds_busy');e.preventDefault();$('<iframe class="ds_dialog" src="'+ds_target('dialog',this.href)+'" />').dialog({title:$(this).attr('title'),autoOpen:true,width:500,height:600,modal:true,resizable:true,autoResize:true,overlay:{opacity:0.5,background:"black"},buttons:{'Spara':function()
{var form=$(this).contents().find('form');form.append('<input type="hidden" name="save" value="1">');return form.submit();},'Avbryt':function()
{$(this).dialog('close');}},close:function()
{ds_parent_reload();}}).width(475).one('load',function()
{parent.$('body').removeClass('ds_busy');});});});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;}