		function chif() {}		
		$(document).ready(function() {		     			
			temp=0;
			$(document).click(function(){
				closeBlockMenu(cur_1);
			});
			$('.dp').datepick({
				showTrigger:'<img src="/images/data.gif" alt="Hotel calendar booking" width="18" height="18" border="0" align="absmiddle">',
				//defaultDate: new Date(),
				selectDefaultDate:true,
				//formatDate:'yyyy-mm-dd',								
				onSelect: function(dates) { 														
					var curDate = dates[0]; 
					year=$.datepick.formatDate('yyyy',curDate);
					month=$.datepick.formatDate('mm',curDate);
					day=$.datepick.formatDate('dd',curDate);										
					if (curDate) {
						today=new Date();
						today.setMinutes(0);
						today.setHours(0);
						today.setSeconds(0);
						if (this.id=='in2') var dateIn = new Date($('#in2').datepick('getDate')[0].getTime());
						else dateIn=new Date();
						if (this.id=='out2') dateOut = new Date($('#out2').datepick('getDate')[0].getTime());
						else dateOut=new Date();
						if (this.id=='in') dateIn2 = new Date($('#in').datepick('getDate')[0].getTime());
						else dateIn2=new Date();
						if (this.id=='out') dateOut2 = new Date($('#out').datepick('getDate')[0].getTime());
						else dateOut2=new Date();						
						if (dateOut-today<-1000) {
							$('#out2').datepick('setDate',new Date());
							day=$.datepick.formatDate('dd',today);
							month=$.datepick.formatDate('mm',today);
							alert("Date can not be less than the current");	
							temp=1;
						} else if (dateIn-today<-1000) {
							$('#in2').datepick('setDate',new Date());
							day=$.datepick.formatDate('dd',today);
							month=$.datepick.formatDate('mm',today);
							alert("Date can not be less than the current");
							temp=1;
						} else if (dateOut2-today<-1000) {
							$('#out').datepick('setDate',new Date());
							day=$.datepick.formatDate('dd',today);
							month=$.datepick.formatDate('mm',today);
							alert("Date can not be less than the current");	
							temp=1;
						} else if (dateIn2-today<-1000) {
							$('#in').datepick('setDate',new Date());
							day=$.datepick.formatDate('dd',today);
							month=$.datepick.formatDate('mm',today);
							alert("Date can not be less than the current");
							temp=1;
						}

					}						
					if (this.id=='in') {
						$('#inday').val(day);
						$('#inmonth').val(month);
						$('#inyear').val(year);					
					} else if (this.id=='out') {
						$('#outday').val(day);
						$('#outmonth').val(month);
						$('#outyear').val(year);					
					} else if (this.id=='in2') {
						$('#inday2').val(day);
						$('#inmonth2').val(month);
						$('#inyear2').val(year);													
						if (document.getElementById('out2').value) calc();
					} else if (this.id=='out2') {
						$('#outday2').val(day);
						$('#outmonth2').val(month);
						$('#outyear2').val(year);					
						calc();
					}
					temp=0;
				} 				
			});
			$('.dpt').datepick({
				showTrigger:'<img src="/images/data.gif" alt="Hotel calendar booking" width="18" height="18" border="0" align="top">',
				//defaultDate: new Date(),
				selectDefaultDate:true,
				//formatDate:'yyyy-mm-dd',								
				onSelect: function(dates) { 														
					var curDate = dates[0]; 
					year=$.datepick.formatDate('yyyy',curDate);
					month=$.datepick.formatDate('mm',curDate);
					day=$.datepick.formatDate('dd',curDate);										
					if (curDate) {
						today=new Date();
						today.setMinutes(0);
						today.setHours(0);
						today.setSeconds(0);
						var date = new Date($('.dpt').datepick('getDate')[0].getTime());
						if (date-today<-1000) {
							$('.dpt').datepick('setDate',new Date());
							day=$.datepick.formatDate('dd',today);
							month=$.datepick.formatDate('mm',today);
							alert("Date can not be less than the current");	
							temp=1;
						}
					}						
					month=parseInt(month);
					$('#trday').val(day);
					$('#trmonth').val(month);
					$('#tryear').val(year);										
					temp=0;
				} 				
			});
			$('a.GBF').fancybox({
			'padding':3,
			'overlayShow':true,
			'overlayOpacity':0.7,
			'overlayColor':'#000',
			'centerOnScroll':	true,
			'titleShow':true,
			'titlePosition':'inside',
			'titleFormat':function () {
				return '<div align=right><a href="javascript:$.fancybox.close();"><img src="/images/arrow_close.gif" border=0></a></div>';
			}
			});
			$('.in2').click(function () {
				calc();				
			});
			$('.in2').change(function () {
				if (!temp) $('#in2').datepick('setDate',new Date($('#inyear2').val(),$('#inmonth2').val()-1,$('#inday2').val()));
				calc();
			});			
			$('.out2').click(function () {
				calc();							
			});
			$('.out2').change(function () {
				if (!temp)$('#out2').datepick('setDate',new Date($('#outyear2').val(),$('#outmonth2').val()-1,$('#outday2').val()));
				calc();							
			});						
			$('.in').change(function () {
				if (!temp) $('#in').datepick('setDate',new Date($('#inyear').val(),$('#inmonth').val()-1,$('#inday').val()));
			});			
			$('.transfer').change(function () {
				if (!temp) $('.dpt').datepick('setDate',new Date($('#tryear').val(),$('#trmonth').val()-1,$('#trday').val()));
			});						
			$('.out').change(function () {
				if (!temp) $('#out').datepick('setDate',new Date($('#outyear').val(),$('#outmonth').val()-1,$('#outday').val()));
			});						
			
			if (document.getElementById('in2')) {
				$('#in2').datepick('setDate',new Date($('#inyear2').val(),$('#inmonth2').val()-1,$('#inday2').val()));
				$('#out2').datepick('setDate',new Date($('#outyear2').val(),$('#outmonth2').val()-1,$('#outday2').val()));
				calc();
			}
			if (document.getElementById('transfer')) {
				$('.dpt').datepick('setDate',new Date());
			}
		});	

function calc()
{
	var dateIn = new Date($('#in2').datepick('getDate')[0].getTime());		
	var dateOut = new Date($('#out2').datepick('getDate')[0].getTime());	
	var datePeriod = (dateOut - dateIn)/(60*60*24*1000);	
	var price = cur_price;	
	var client_num = 1;//parseInt($("#guests").attr('value'));	
	var dop_usl=0;
	$('.dopuslugi').each(function(index){
		if (this.checked) dop_usl+=parseInt(this.alt);
	});	
	price+=dop_usl;	
	var priceAll = 0;
	var timeCof = 0;
	
	if((datePeriod > 0 || (datePeriod == 0 && timeCof > 0)) && client_num > 0){
		
		priceAll = datePeriod * price*client_num;
	}else{
		priceAll = 0;
	}	
	$("#price").html('<strong>'+priceAll+' ruble</strong> (~'+Math.ceil(priceAll/eur)+' Euro) (~'+Math.ceil(priceAll/doll)+' USD)');
}		

function refresh_guests() {
	result='<select name="guests" id="guests">';
	for (i=1; i<=max_guests; i++) {
	   result+='<option value="'+i+'">'+i+'</option>';
	}
	result+='</select>';	
	$('#guests_row').html(result);
}
		

