function catcalc(cal) {
        var date = cal.date;
        var time = date.getTime()
        
        
        // use the _other_ field
        var field  = document.getElementById("departure_date_show");
        var field2 = document.getElementById("departure_date_value");
        var field3 = document.getElementById("arrival_date_value");
        
        if (field	 == cal.params.inputField) 
        {
        
        } 
        else 
        {		
						
            time2 = time + Date.DAY; 
        }
        var date1 = new Date(time);
        var date2 = new Date(time2);
        field.value = date2.print("%d.  %B  %Y");
        document.getElementById("departure_date_value").value = date2.print("%Y-%m-%d");
        document.getElementById("arrival_date_value").value 	= date1.print("%Y-%m-%d");
    }
	//input by one-click the button    
		
   Calendar.setup({        
        inputField     :    "arrival_date_show",   // id of the input field
        ifFormat       :    "%d. %B  %Y",       // format of the input field    
        timeFormat     :    "24",
        onUpdate       :    catcalc,
        button         :    "trigger_arrival_date",  // trigger for the calendar (button ID)    
        range          : 	[2011, 2050]
    });   
    Calendar.setup({
        inputField     :    "departure_date_show",
        ifFormat       :    "%d.  %B  %Y",	//"%Y-%m-%d %H:%M",    
        timeFormat     :    "24",
        button         :    "trigger_departure_date",  // trigger for the calendar (button ID)  
        range          : 	[2011, 2050]
    });
    Calendar.setup({        
        inputField     :    "galerie_datum",   // id of the input field
        ifFormat       :    "%d.%m.%Y",       // format of the input field    
        timeFormat     :    "24",
        onUpdate       :    catcalc,
        button         :    "galerie_datum",  // trigger for the calendar (button ID)    
        range          : 	[2010, 2050]
    }); 
    
  //input by one-click the input field
    Calendar.setup2({        
        inputField     :    "arrival_date_show",   // id of the input field
        ifFormat       :    "%d.  %B  %Y",       // format of the input field    
        timeFormat     :    "24",  
        onUpdate       :    catcalc,        
        range          : 	[2011, 2050]
    });         
    
    Calendar.setup2({
        inputField     :    "departure_date_show",
        ifFormat       :    "%d.  %B  %Y",	//"%Y-%m-%d %H:%M",    
        timeFormat     :    "24",
        range          : 	[2011, 2050]
    });
   
